pgsql: Include all columns in default names for foreign key constraints

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Include all columns in default names for foreign key constraints

Peter Eisentraut-3
Include all columns in default names for foreign key constraints

When creating a name for a foreign key constraint when none is
specified, use all column names instead of only the first one, similar
to how it is already done for index names.

Author: Paul Martinez <[hidden email]>
Reviewed-by: Peter Eisentraut <[hidden email]>
Discussion: https://www.postgresql.org/message-id/flat/CAF+2_SFjky6XRfLNRXpkG97W6PRbOO_mjAxqXzAAimU=c7w7_A@...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f177660ab01e53dd5597b195dcc8526baa5cfcbd

Modified Files
--------------
src/backend/commands/indexcmds.c          |   3 +-
src/backend/commands/statscmds.c          |   3 +-
src/backend/commands/tablecmds.c          |  42 ++++++++-
src/test/regress/expected/alter_table.out |   8 +-
src/test/regress/expected/foreign_key.out | 140 +++++++++++++++++-------------
src/test/regress/expected/rules.out       |  12 +--
src/test/regress/sql/foreign_key.sql      |  20 ++++-
7 files changed, 152 insertions(+), 76 deletions(-)