postgresql/src/include/utils
Tom Lane 074c5cfbfb Fix handling of inherited check constraints in ALTER COLUMN TYPE (again).
The previous way of reconstructing check constraints was to do a separate
"ALTER TABLE ONLY tab ADD CONSTRAINT" for each table in an inheritance
hierarchy.  However, that way has no hope of reconstructing the check
constraints' own inheritance properties correctly, as pointed out in
bug #13779 from Jan Dirk Zijlstra.  What we should do instead is to do
a regular "ALTER TABLE", allowing recursion, at the topmost table that
has a particular constraint, and then suppress the work queue entries
for inherited instances of the constraint.

Annoyingly, we'd tried to fix this behavior before, in commit 5ed6546cf,
but we failed to notice that it wasn't reconstructing the pg_constraint
field values correctly.

As long as I'm touching pg_get_constraintdef_worker anyway, tweak it to
always schema-qualify the target table name; this seems like useful backup
to the protections installed by commit 5f173040.

In HEAD/9.5, get rid of get_constraint_relation_oids, which is now unused.
(I could alternatively have modified it to also return conislocal, but that
seemed like a pretty single-purpose API, so let's not pretend it has some
other use.)  It's unused in the back branches as well, but I left it in
place just in case some third-party code has decided to use it.

In HEAD/9.5, also rename pg_get_constraintdef_string to
pg_get_constraintdef_command, as the previous name did nothing to explain
what that entry point did differently from others (and its comment was
equally useless).  Again, that change doesn't seem like material for
back-patching.

I did a bit of re-pgindenting in tablecmds.c in HEAD/9.5, as well.

Otherwise, back-patch to all supported branches.
2015-11-20 14:55:47 -05:00
..
.gitignore
acl.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
aclchk_internal.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
array.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
arrayaccess.h Rely on inline functions even if that causes warnings in older compilers. 2015-08-05 18:19:52 +02:00
ascii.h
attoptcache.h
builtins.h Add "xid <> xid" and "xid <> int4" operators. 2015-11-07 16:40:15 -05:00
bytea.h
cash.h
catcache.h
combocid.h Create an infrastructure for parallel computation in PostgreSQL. 2015-04-30 15:02:14 -04:00
date.h Fix incorrect translation of minus-infinity datetimes for json/jsonb. 2015-10-20 11:07:04 -07:00
datetime.h Fix incorrect translation of minus-infinity datetimes for json/jsonb. 2015-10-20 11:07:04 -07:00
datum.h Parallel executor support. 2015-09-28 21:55:57 -04:00
dynahash.h
dynamic_loader.h
elog.h Correct pg_indent to pgindent in various comments. 2015-10-08 12:27:54 -04:00
evtcache.h
expandeddatum.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
fmgrtab.h
formatting.h
geo_decls.h Allow GiST distance function to return merely a lower-bound. 2015-05-15 14:26:51 +03:00
guc_tables.h Group cluster_name and update_process_title settings together 2015-10-04 12:29:36 -04:00
guc.h Add an optional missing_ok argument to SQL function current_setting(). 2015-07-02 16:41:07 -04:00
help_config.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
hsearch.h
inet.h Add index-only scan support to inet GiST opclass. 2015-03-28 15:11:53 +02:00
int8.h
inval.h
json.h
jsonapi.h Support JSON negative array subscripts everywhere 2015-07-17 21:13:47 -04:00
jsonb.h Rename jsonb_replace to jsonb_set and allow it to add new values 2015-05-31 20:34:10 -04:00
logtape.h
lsyscache.h Generate parallel sequential scan plans in simple cases. 2015-11-11 09:02:52 -05:00
memdebug.h
memutils.h Limit the verbosity of memory context statistics dumps. 2015-08-25 13:09:48 -04:00
nabstime.h
numeric.h
palloc.h Rely on inline functions even if that causes warnings in older compilers. 2015-08-05 18:19:52 +02:00
pg_crc.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
pg_locale.h Revoke support for strxfrm() that write past the specified array length. 2015-07-08 20:44:21 -04:00
pg_lsn.h
pg_rusage.h
plancache.h Remove the SECURITY_ROW_LEVEL_DISABLED security context bit. 2015-09-20 20:47:17 -04:00
portal.h Fix subtransaction cleanup after an outer-subtransaction portal fails. 2015-09-04 13:37:14 -04:00
ps_status.h
rangetypes.h Move strategy numbers to include/access/stratnum.h 2015-05-15 17:03:16 -03:00
rel.h Fix more typos in comments. 2015-05-20 19:45:43 +03:00
relcache.h Fix the logic for putting relations into the relcache init file. 2015-06-25 14:39:05 -04:00
relfilenodemap.h
relmapper.h
reltrigger.h
resowner_private.h
resowner.h
rls.h Remove the row_security=force GUC value. 2015-09-20 20:45:41 -04:00
ruleutils.h Fix handling of inherited check constraints in ALTER COLUMN TYPE (again). 2015-11-20 14:55:47 -05:00
sampling.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
selfuncs.h Allow planner to use expression-index stats for function calls in WHERE. 2015-09-24 18:35:46 -04:00
snapmgr.h Create an infrastructure for parallel computation in PostgreSQL. 2015-04-30 15:02:14 -04:00
snapshot.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
sortsupport.h Rely on inline functions even if that causes warnings in older compilers. 2015-08-05 18:19:52 +02:00
spccache.h Allow per-tablespace effective_io_concurrency 2015-09-08 12:51:42 -03:00
syscache.h Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
timeout.h
timestamp.h Add transform functions for AT TIME ZONE. 2015-03-01 13:22:34 -05:00
tqual.h Add opaque declaration of HTAB to tqual.h. 2015-06-27 09:55:06 -05:00
tuplesort.h
tuplestore.h
typcache.h Use the typcache to cache constraints for domain types. 2015-03-01 14:06:55 -05:00
tzparser.h
uuid.h
varbit.h
xml.h