postgresql/src/include
Peter Eisentraut 19781729f7 Make identity sequence management more robust
Some code could get confused when certain catalog state involving both
identity and serial sequences was present, perhaps during an attempt
to upgrade the latter to the former.  Specifically, dropping the
default of a serial column maintains the ownership of the sequence by
the column, and so it would then be possible to afterwards make the
column an identity column that would now own two sequences.  This
causes the code that looks up the identity sequence to error out,
making the new identity column inoperable until the ownership of the
previous sequence is released.

To fix this, make the identity sequence lookup only consider sequences
with the appropriate dependency type for an identity sequence, so it
only ever finds one (unless something else is broken).  In the above
example, the old serial sequence would then be ignored.  Reorganize
the various owned-sequence-lookup functions a bit to make this
clearer.

Reported-by: Laurenz Albe <laurenz.albe@cybertec.at>
Discussion: https://www.postgresql.org/message-id/flat/470c54fc8590be4de0f41b0d295fd6390d5e8a6c.camel@cybertec.at
2019-07-22 12:07:10 +02:00
..
access Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
bootstrap Remove more unreferenced function declarations 2019-07-07 09:58:33 +09:00
catalog Make identity sequence management more robust 2019-07-22 12:07:10 +02:00
commands Remove unreferenced function declarations. 2019-07-05 19:28:45 -04:00
common Introduce safer encoding and decoding routines for base64.c 2019-07-04 16:08:09 +09:00
datatype Update copyright for 2019 2019-01-02 12:44:25 -05:00
executor Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
fe_utils Fix typos in various places 2019-06-03 13:44:03 +09:00
foreign Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
jit Fix duplicated words in comments 2019-05-14 09:37:35 +09:00
lib Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
libpq Update hardcoded DH parameters to IANA standards 2019-07-05 10:47:32 +09:00
mb Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
nodes Speed up finding EquivalenceClasses for a given set of rels 2019-07-21 17:30:58 +12:00
optimizer Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
parser Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
partitioning Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
port Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
portability Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Mark ReplicationSlotCtl as PGDLLIMPORT. 2019-06-13 10:53:34 -04:00
rewrite Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
snowball Sync our Snowball stemmer dictionaries with current upstream 2019-07-04 13:26:48 +02:00
statistics Rework examine_opclause_expression to use varonleft 2019-07-20 16:37:30 +02:00
storage Move some md.c-specific logic from smgr.c to md.c. 2019-07-17 15:00:22 +12:00
tcop Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
fmgr.h Fix double-word typos 2019-06-13 10:03:56 -04:00
funcapi.h Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
getaddrinfo.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
getopt_long.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
miscadmin.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pg_config.h.in Remove remaining traces of Rand_OpenSSL() from the tree 2019-06-27 08:25:26 +09:00
pg_config.h.win32 Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_getopt.h Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
pg_trace.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstat.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtar.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtime.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
port.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
postgres.h Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
rusagestub.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowapi.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00