postgres/src/tools
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
..
ci ci: Add continuous integration for github repositories via cirrus-ci. 2021-12-30 19:02:44 -08:00
editors Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
ifaddrs Update copyright for 2022 2022-01-07 19:04:57 -05:00
msvc Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
perlcheck Prohibit map and grep in void context 2021-08-31 11:07:04 +02:00
pginclude Add missing include guard to win32ntdll.h. 2022-01-12 10:19:00 +13:00
pgindent Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
ccsym
check_bison_recursion.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
codelines
copyright.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
find_badmacros
find_static Fix omission of -X (--no-psqlrc) in some psql invocations. 2015-12-28 11:46:43 -05:00
find_typedef Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
fix-old-flex-code.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
gen_keywordlist.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
git_changelog Update copyright for 2022 2022-01-07 19:04:57 -05:00
git-external-diff Preserve information on use of git-external-diff 2018-05-24 23:45:31 +09:30
make_ctags Improve missing-program error handling in make_ctags and make_etags. 2019-01-13 13:33:50 -05:00
make_etags Improve missing-program error handling in make_ctags and make_etags. 2019-01-13 13:33:50 -05:00
make_mkid
PerfectHash.pm Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgtest pgtest: run clean, build, and check stages separately 2018-07-28 15:34:06 -04:00
RELEASE_CHANGES Doc: further updates for RELEASE_CHANGES process notes. 2021-06-28 18:05:46 -04:00
testint128.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
valgrind.supp Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms. 2020-06-08 19:52:19 -07:00
version_stamp.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
win32tzlist.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00