postgresql/src/bin
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
..
initdb Fix global ICU collations for ICU < 54 2022-03-20 10:21:45 +01:00
pg_amcheck Harden TAP tests that intentionally corrupt page checksums. 2022-03-25 14:23:26 -04:00
pg_archivecleanup Replace Test::More plans with done_testing 2022-02-11 20:54:44 +01:00
pg_basebackup Fix a few goofs in new backup compression code. 2022-03-28 12:19:05 -04:00
pg_checksums Harden TAP tests that intentionally corrupt page checksums. 2022-03-25 14:23:26 -04:00
pg_config Replace Test::More plans with done_testing 2022-02-11 20:54:44 +01:00
pg_controldata Replace Test::More plans with done_testing 2022-02-11 20:54:44 +01:00
pg_ctl Remove more unused module imports from TAP tests 2022-03-27 22:26:40 +02:00
pg_dump Allow specifying column lists for logical replication 2022-03-26 01:01:27 +01:00
pg_resetwal Replace Test::More plans with done_testing 2022-02-11 20:54:44 +01:00
pg_rewind Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
pg_test_fsync Remove unused module imports from TAP tests 2022-03-24 20:51:40 +01:00
pg_test_timing Remove unused module imports from TAP tests 2022-03-24 20:51:40 +01:00
pg_upgrade Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
pg_verifybackup Remove unused module imports from TAP tests 2022-03-24 20:51:40 +01:00
pg_waldump waldump: fix use-after-free in search_directory(). 2022-03-27 18:13:50 -07:00
pgbench Avoid using large pass-by-value struct arguments in pgbench. 2022-03-27 14:38:05 -04:00
pgevent Update copyright for 2022 2022-01-07 19:04:57 -05:00
psql Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
scripts Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00