postgresql/src/include
Álvaro Herrera 8d9a97e0bb
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
..
access Update obsolete comment 2026-02-18 18:09:54 +01:00
archive
backup
bootstrap
catalog Avoid name collision with NOT NULL constraints 2026-02-21 12:22:08 +01:00
commands Harden _int_matchsel() against being attached to the wrong operator. 2026-02-09 10:14:22 -05:00
common
datatype
executor
fe_utils
foreign
jit
lib
libpq
mb Replace pg_mblen() with bounds-checked versions. 2026-02-09 12:43:42 +13:00
nodes Fix query jumbling with GROUP BY clauses 2026-01-14 08:44:52 +09:00
optimizer Strip PlaceHolderVars from index operands 2025-12-29 11:43:06 +09:00
parser
partitioning
pch
port Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:05:21 +13:00
portability
postmaster
regex
replication
rewrite
snowball
statistics
storage Add file_extend_method=posix_fallocate,write_zeros. 2026-02-06 17:38:39 +13:00
tcop
tsearch Replace pg_mblen() with bounds-checked versions. 2026-02-09 12:43:42 +13:00
utils Guard against unexpected dimensions of oidvector/int2vector. 2026-02-09 09:57:44 -05:00
.gitignore
c.h
fmgr.h
funcapi.h
getopt_long.h
Makefile Fix build inconsistency due to the generation of wait-event code 2026-02-02 08:02:59 +09:00
meson.build
miscadmin.h Avoid mixing void and integer in a conditional expression. 2025-11-02 12:31:01 -05:00
pg_config.h.in
pg_config_manual.h
pg_getopt.h
pg_trace.h
pgstat.h
pgtar.h
pgtime.h
port.h Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:05:21 +13:00
postgres.h
postgres_ext.h
postgres_fe.h
varatt.h
windowapi.h