postgresql/src/include/utils
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
..
.gitignore Revert "Add gitignore entries for jsonpath_gram.h" 2019-03-23 00:19:34 +01:00
acl.h Add String object access hooks 2022-03-22 10:28:31 -04:00
aclchk_internal.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
array.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
arrayaccess.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ascii.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
attoptcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
backend_progress.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
backend_status.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
builtins.h Remove pg_atoi() 2022-02-15 07:44:26 +01:00
bytea.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
cash.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
combocid.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
date.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
datetime.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
datum.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
dsa.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
dynahash.h Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
elog.h Introduce log_destination=jsonlog 2022-01-17 10:16:53 +09:00
evtcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
expandeddatum.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
expandedrecord.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
float.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
fmgrtab.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
formatting.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
freepage.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
geo_decls.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
guc.h Disallow setting bogus GUCs within an extension's reserved namespace. 2022-02-21 14:10:43 -05:00
guc_tables.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
help_config.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
hsearch.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
index_selfuncs.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
inet.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
inval.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
json.h IS JSON predicate 2022-03-28 15:37:08 -04:00
jsonb.h SQL/JSON constructors 2022-03-27 17:03:34 -04:00
jsonfuncs.h IS JSON predicate 2022-03-28 15:37:08 -04:00
jsonpath.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logtape.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
lsyscache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
memdebug.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
memutils.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
multirangetypes.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
numeric.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
old_snapshot.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
palloc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
partcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_crc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_locale.h Fix global ICU collations for ICU < 54 2022-03-20 10:21:45 +01:00
pg_lsn.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_rusage.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgstat_internal.h pgstat: split different types of stats into separate files. 2022-03-21 12:02:25 -07:00
pidfile.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
plancache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
portal.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ps_status.h Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
queryenvironment.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
queryjumble.h Add compute_query_id = regress 2022-02-22 10:22:15 +09:00
rangetypes.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
regproc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
rel.h Add support for security invoker views. 2022-03-22 10:28:10 +00:00
relcache.h Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
relfilenodemap.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
relmapper.h Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
relptr.h Suppress compiler warning in relptr_store(). 2022-03-26 14:30:09 -04:00
reltrigger.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
resowner.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
resowner_private.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
rls.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ruleutils.h Add public ruleutils.c entry point to deparse a Query. 2022-03-28 11:19:37 -04:00
sampling.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
selfuncs.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
sharedtuplestore.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
snapmgr.h Assert in init_toast_snapshot() that some snapshot registered or active. 2022-02-21 08:58:29 -08:00
snapshot.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
sortsupport.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
spccache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
syscache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
timeout.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
timestamp.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
tuplesort.h Add UNIQUE null treatment option 2022-02-03 11:48:21 +01:00
tuplestore.h Remove all traces of tuplestore_donestoring() in the C code 2022-02-17 09:52:02 +09:00
typcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
tzparser.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
uuid.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
varbit.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
varlena.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
wait_event.h Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
xid8.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
xml.h Update copyright for 2022 2022-01-07 19:04:57 -05:00