Re: Adding a pg_get_owned_sequence function? - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Adding a pg_get_owned_sequence function?
Date
Msg-id 20230901164250.GA3178187@nathanxps13
Whole thread Raw
In response to Adding a pg_get_owned_sequence function?  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Responses Re: Adding a pg_get_owned_sequence function?
List 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



pgsql-hackers by date:

Previous
From: jacktby jacktby
Date:
Subject: Is there a complete doc to describe pg's traction implementation in detail?
Next
From: Nathan Bossart
Date:
Subject: Re: Inefficiency in parallel pg_restore with many tables