postgresql/src/include/catalog
Álvaro Herrera 0eeffd31bf
Avoid name collision with NOT NULL constraints
If a CREATE TABLE statement defined a constraint whose name is identical
to the name generated for a NOT NULL constraint, we'd throw an
(unnecessary) unique key violation error on
pg_constraint_conrelid_contypid_conname_index: this can easily be
avoided by choosing a different name for the NOT NULL constraint.

Fix by passing the constraint names already created by
AddRelationNewConstraints() to AddRelationNotNullConstraints(), so that
the latter can avoid name collisions with them.

Bug: #19393
Author: Laurenz Albe <laurenz.albe@cybertec.at>
Reported-by: Hüseyin Demir <huseyin.d3r@gmail.com>
Backpatch-through: 18
Discussion: https://postgr.es/m/19393-6a82427485a744cf@postgresql.org
2026-02-21 12:22:08 +01:00
..
.gitignore Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
binary_upgrade.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
catalog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
catversion.h Add per-subscription wal_receiver_timeout setting. 2026-02-20 01:00:09 +09:00
dependency.h Harden _int_matchsel() against being attached to the wrong operator. 2026-02-09 10:14:22 -05:00
duplicate_oids Update copyright for 2026 2026-01-01 13:24:10 -05:00
genbki.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
heap.h Avoid name collision with NOT NULL constraints 2026-02-21 12:22:08 +01:00
index.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
indexing.h Stop including {brin,gin}_tuple.h in tuplesort.h 2026-01-12 18:09:49 +01:00
Makefile Ensure that all three build methods install the same set of files. 2026-02-16 15:20:15 -05:00
meson.build Ensure that all three build methods install the same set of files. 2026-02-16 15:20:15 -05:00
namespace.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
objectaccess.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
objectaddress.h Switch SysCacheIdentifier to a typedef enum 2026-02-18 09:58:38 +09:00
partition.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_aggregate.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_aggregate.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_am.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_am.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_amop.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_amop.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_amproc.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_amproc.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_attrdef.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_attribute.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_auth_members.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_authid.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_authid.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_cast.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_cast.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_class.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_class.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_collation.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_collation.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_constraint.h Reject ADD CONSTRAINT NOT NULL if name mismatches existing constraint 2026-02-03 12:33:29 +01:00
pg_control.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_conversion.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_conversion.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_database.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_database.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_db_role_setting.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_default_acl.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_depend.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_description.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_enum.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_event_trigger.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_extension.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_foreign_data_wrapper.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_foreign_server.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_foreign_table.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_index.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_inherits.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_init_privs.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_language.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_language.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_largeobject.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_largeobject_metadata.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_namespace.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_namespace.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_opclass.dat Mark GiST inet_ops as opcdefault, and deal with ensuing fallout. 2026-01-08 14:03:56 -05:00
pg_opclass.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_operator.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_operator.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_opfamily.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_opfamily.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_parameter_acl.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_partitioned_table.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_policy.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_proc.dat Simplify creation of built-in functions with default arguments. 2026-02-18 14:14:44 -05:00
pg_proc.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_publication.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_publication_namespace.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_publication_rel.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_range.dat Record range constructor functions in pg_range 2026-01-22 15:56:29 +01:00
pg_range.h Record range constructor functions in pg_range 2026-01-22 15:56:29 +01:00
pg_replication_origin.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_rewrite.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_seclabel.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_sequence.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_shdepend.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_shdescription.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_shseclabel.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_statistic.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_statistic_ext.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_statistic_ext_data.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_subscription.h Add per-subscription wal_receiver_timeout setting. 2026-02-20 01:00:09 +09:00
pg_subscription_rel.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_tablespace.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_tablespace.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_transform.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_trigger.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_config.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_config.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_config_map.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_config_map.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_dict.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_dict.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_parser.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_parser.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_template.dat Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_ts_template.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_type.dat Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
pg_type.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_user_mapping.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
README Add src/include/catalog/README 2025-08-19 08:41:42 +02:00
reformat_dat_file.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
renumber_oids.pl Update copyright for 2026 2026-01-01 13:24:10 -05:00
storage.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
storage_xlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
toasting.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
unused_oids Update copyright for 2026 2026-01-01 13:24:10 -05:00

See <https://www.postgresql.org/docs/devel/bki.html> about the
files in this directory.