pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assorted bugs related to identity column in partitioned tabl
Date: Tue, 07 May 2024 21:03:43 +0000
Message-ID: <E1s4RyQ-0023Pu-LU@gemulon.postgresql.org> (raw)

Fix assorted bugs related to identity column in partitioned tables

When changing the data type of a column of a partitioned table, craft
the ALTER SEQUENCE command only once.  Partitions do not have identity
sequences of their own and thus do not need a ALTER SEQUENCE command
for each partition.

Fix getIdentitySequence() to fetch the identity sequence associated
with the top-level partitioned table when a Relation of a partition is
passed to it.  While doing so, translate the attribute number of the
partition into the attribute number of the partitioned table.

Author: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>
Discussion: https://www.postgresql.org/message-id/3b8a9dc1-bbc7-0ef5-6863-c432afac7d59@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/509199587df73f06eda898ae13284292f4ae573a

Modified Files
--------------
src/backend/catalog/pg_depend.c        | 31 ++++++++++++++++++--
src/backend/commands/tablecmds.c       |  2 +-
src/backend/parser/parse_utilcmd.c     | 52 ++++++++++++++++++++--------------
src/backend/rewrite/rewriteHandler.c   | 19 +------------
src/include/catalog/dependency.h       |  2 +-
src/test/regress/expected/identity.out | 32 +++++++++++++++++++--
src/test/regress/sql/identity.sql      | 11 +++++--
7 files changed, 101 insertions(+), 48 deletions(-)



Message-ID: <E1s4RyQ-0023Pu-LU@gemulon.postgresql.org>
Permalink:  ../E1s4RyQ-0023Pu-LU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s4RyQ-0023Pu-LU@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix assorted bugs related to identity column in partitioned tabl
  In-Reply-To: <E1s4RyQ-0023Pu-LU@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox