postgresql/src/include
Robert Haas 9c08aea6a3 Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.

Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.

Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.

Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 11:48:36 -04:00
..
access Revert "Fix replay of create database records on standby" 2022-03-29 15:36:21 +02:00
bootstrap Update copyright for 2022 2022-01-07 19:04:57 -05:00
catalog Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
commands Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
common Replace BASE_BACKUP COMPRESSION_LEVEL option with COMPRESSION_DETAIL. 2022-03-23 09:19:14 -04:00
datatype Update copyright for 2022 2022-01-07 19:04:57 -05:00
executor IS JSON predicate 2022-03-28 15:37:08 -04:00
fe_utils Allow pgbench to retry in some cases. 2022-03-23 19:05:45 +09:00
foreign Update copyright for 2022 2022-01-07 19:04:57 -05:00
jit Update copyright for 2022 2022-01-07 19:04:57 -05:00
lib dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
libpq Add system view pg_ident_file_mappings 2022-03-29 10:15:48 +09:00
mb Update copyright for 2022 2022-01-07 19:04:57 -05:00
nodes IS JSON predicate 2022-03-28 15:37:08 -04:00
optimizer Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
parser IS JSON predicate 2022-03-28 15:37:08 -04:00
partitioning Update copyright for 2022 2022-01-07 19:04:57 -05:00
port Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
portability Update copyright for 2022 2022-01-07 19:04:57 -05:00
postmaster Allow archiving via loadable modules. 2022-02-03 14:05:02 -05:00
regex Update copyright for 2022 2022-01-07 19:04:57 -05:00
replication Allow specifying column lists for logical replication 2022-03-26 01:01:27 +01:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
storage Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
tcop Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
Makefile Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
c.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
fmgr.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
funcapi.h Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
getaddrinfo.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
getopt_long.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
miscadmin.h Remove MaxBackends variable in favor of GetMaxBackends() function. 2022-02-08 15:53:19 -05:00
pg_config.h.in Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
pg_config_ext.h.in
pg_config_manual.h Fix DROP {DATABASE,TABLESPACE} on Windows. 2022-02-12 10:21:23 +13:00
pg_getopt.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_trace.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgstat.h pgstat: reorder pgstat.[ch] contents. 2022-03-21 16:21:00 -07:00
pgtar.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgtime.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
port.h Clean up messy API for src/port/thread.c. 2022-01-11 13:46:20 -05:00
postgres.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
rusagestub.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
windowapi.h Update copyright for 2022 2022-01-07 19:04:57 -05:00