Re: Adding a pg_get_owned_sequence function?

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adding a pg_get_owned_sequence function?
Date: 2023-09-01 16:42:50
Message-ID: 20230901164250.GA3178187@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 09, 2023 at 08:19:44PM +0100, Dagfinn Ilmari Mannsåker wrote:
> I've always been annoyed by the fact that pg_get_serial_sequence takes
> the table and returns the sequence as strings rather than regclass. And
> since identity columns were added, the name is misleading as well (which
> is even acknowledged in the docs, together with a suggestion for a
> better name).
>
> So, instead of making excuses in the documentation, I thought why not
> add a new function which addresses all of these issues, and document the
> old one as a backward-compatibilty wrapper?

This sounds generally reasonable to me. That note has been there since
2006 (2b2a507). I didn't find any further discussion about this on the
lists.

> + A backwards-compatibility wrapper
> + for <function>pg_get_owned_sequence</function>, which
> + uses <type>text</type> for the table and sequence names instead of
> + <type>regclass</type>. The first parameter is a table name with optional

I wonder if it'd be possible to just remove pg_get_serial_sequence().
Assuming 2b2a507 removed the last use of it in pg_dump, any dump files
created on versions >= v8.2 shouldn't use it. But I suppose it wouldn't be
too much trouble to keep it around for anyone who happens to need it.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-09-01 16:55:35 Re: Fwd: BUG #18016: REINDEX TABLE failure
Previous Message jacktby jacktby 2023-09-01 16:41:14 Is there a complete doc to describe pg's traction implementation in detail?