public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Michael Paquier <[email protected]>
To: Tomas Vondra <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Sequence Access Methods, round two
Date: Wed, 13 Mar 2024 07:00:37 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<CAHut+Ps27m0bCmmPYNXC282phpm1vkS+_kmHRR=mKHDuJd0C9Q@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

On 12.03.24 00:44, Michael Paquier wrote:
> Anyway, there is one piece of this patch set that I think has a lot of
> value outside of the discussion with access methods, which is to
> redesign pg_sequence_last_value so as it returns a (last_value,
> is_called) tuple rather than a (last_value).  This has the benefit of
> switching pg_dump to use this function rather than relying on a scan
> of the heap table used by a sequence to retrieve the state of a
> sequence dumped.  This is the main diff:
> -    appendPQExpBuffer(query,
> -                      "SELECT last_value, is_called FROM %s",
> -                      fmtQualifiedDumpable(tbinfo));
> +    /*
> +     * In versions 17 and up, pg_sequence_last_value() has been switched to
> +     * return a tuple with last_value and is_called.
> +     */
> +    if (fout->remoteVersion >= 170000)
> +        appendPQExpBuffer(query,
> +                          "SELECT last_value, is_called "
> +                          "FROM pg_sequence_last_value('%s')",
> +                          fmtQualifiedDumpable(tbinfo));
> +    else
> +        appendPQExpBuffer(query,
> +                          "SELECT last_value, is_called FROM %s",
> +                          fmtQualifiedDumpable(tbinfo));
> 
> Are there any objections to that?  pg_sequence_last_value() is
> something that we've only been relying on internally for the catalog
> pg_sequences.

I don't understand what the overall benefit of this change is supposed 
to be.

If this route were to be pursued, it should be a different function 
name.  We shouldn't change the signature of an existing function.







view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Sequence Access Methods, round two
  In-Reply-To: <[email protected]>

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

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