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