agora inbox for [email protected]
help / color / mirror / Atom feedRe: POLA violation with \c service=
992+ messages / 5 participants
[nested] [flat]
* Re: POLA violation with \c service=
@ 2015-02-01 07:38 Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
0 siblings, 1 reply; 992+ messages in thread
From: Pavel Stehule @ 2015-02-01 07:38 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
Hi all
I am sending a review of this patch:
* What it does? - Allow to connect to other db by \connect uri connection
format
postgres=# \c postgresql://localhost?service=old
psql (9.5devel, server 9.2.9)
You are now connected to database "postgres" as user "pavel".
* Would we this feature? - yes, it eliminate inconsistency between cmd line
connect and \connect. It is good idea without any objections.
* This patch is cleanly applicable, later compilation without any issues
* All regress tests passed
* A psql documentation is updated -- this feature (and format) is not
widely known, so maybe some more examples are welcome
* When I tested this feature, it worked as expected
* Code respects PostgreSQL coding rules. I prefer a little bit different
test if keep password. Current code is little bit harder to understand. But
I can live with David's code well too.
if
(!user)
user = PQuser(o_conn);
if
(!host)
host =
PQhost(o_conn);
if
(!port)
port =
PQport(o_conn);
if
(dbname)
has_connection_string =
recognized_connection_string(dbname);
/* we should not to keep password if some connection property is changed
*/
keep_password = strcmp(user, PQuser(o_conn)) == 0 && strcmp(host,
PQhost(o_conn)) == 0
&& strcmp(port, PQport(o_conn)) == 0 &&
!has_connection_string;
I have not any other comments.
Possible questions:
1. more examples in doc
2. small change how to check keep_password
Regards
Pavel
2015-01-13 15:00 GMT+01:00 David Fetter <[email protected]>:
> On Sat, Jan 10, 2015 at 04:41:16PM -0800, David Fetter wrote:
> > On Sat, Jan 10, 2015 at 09:30:57AM +0100, Erik Rijkers wrote:
> > > On Fri, January 9, 2015 20:15, David Fetter wrote:
> > > > [psql_fix_uri_service_003.patch]
> > >
> > > Applies on master; the feature (switching services) works well but a
> \c without any parameters produces a segfault:
> > >
> > > (centos 6.6, 4.9.2, 64-bit)
> > >
> > >
> > > $ echo -en "$PGSERVICEFILE\n$PGSERVICE\n$PGPORT\n"
> > > /home/aardvark/.pg_service
> > > service_pola
> > > 6968
> > >
> > > $ psql
> > > Timing is on.
> > > psql (9.5devel_service_pola_20150109_2340_ac7009abd228)
> > > Type "help" for help.
> > >
> > > testdb=# \c service=HEAD
> > > You are now connected to database "testdb" as user "aardvark" via
> socket in "/tmp" at port "6545".
> > > testdb=# \c service=service_pola
> > > You are now connected to database "testdb" as user "aardvark" via
> socket in "/tmp" at port "6968".
> > > testdb=# \c
> > > Segmentation fault (core dumped)
> >
> > Fixed by running that function only if the argument exists.
> >
> > More C cleanups, too.
>
> Added to the upcoming commitfest.
>
> Cheers,
> David.
> --
> David Fetter <[email protected]> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: [email protected]
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>
>
> --
> Sent via pgsql-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
@ 2015-02-19 18:51 ` David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
0 siblings, 1 reply; 992+ messages in thread
From: David Fetter @ 2015-02-19 18:51 UTC (permalink / raw)
To: Pavel Stehule <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Sun, Feb 01, 2015 at 08:38:24AM +0100, Pavel Stehule wrote:
> Hi all
>
> I am sending a review of this patch:
>
> * What it does? - Allow to connect to other db by \connect uri connection
> format
>
> postgres=# \c postgresql://localhost?service=old
> psql (9.5devel, server 9.2.9)
> You are now connected to database "postgres" as user "pavel".
>
> * Would we this feature? - yes, it eliminate inconsistency between cmd line
> connect and \connect. It is good idea without any objections.
>
> * This patch is cleanly applicable, later compilation without any issues
>
> * All regress tests passed
>
> * A psql documentation is updated -- this feature (and format) is not
> widely known, so maybe some more examples are welcome
>
> * When I tested this feature, it worked as expected
>
> * Code respects PostgreSQL coding rules. I prefer a little bit different
> test if keep password. Current code is little bit harder to understand. But
> I can live with David's code well too.
>
> if
> (!user)
>
> user = PQuser(o_conn);
>
> if
> (!host)
>
> host =
> PQhost(o_conn);
>
>
> if
> (!port)
>
> port =
> PQport(o_conn);
>
>
> if
> (dbname)
>
> has_connection_string =
> recognized_connection_string(dbname);
>
>
> /* we should not to keep password if some connection property is changed
> */
>
>
> keep_password = strcmp(user, PQuser(o_conn)) == 0 && strcmp(host,
> PQhost(o_conn)) == 0
> && strcmp(port, PQport(o_conn)) == 0 &&
> !has_connection_string;
Changed. This is cleaner.
> I have not any other comments.
>
> Possible questions:
> 1. more examples in doc
I'm not sure how best to illustrate those. Are you thinking of one
example each for the URI and conninfo cases?
> 2. small change how to check keep_password
Done.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..cae6bf4 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..ec86e52 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/plain] psql_fix_uri_service_005.patch (8.1K, ../../[email protected]/2-psql_fix_uri_service_005.patch)
download | inline diff:
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..cae6bf4 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..ec86e52 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-19 20:32 ` Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
0 siblings, 1 reply; 992+ messages in thread
From: Pavel Stehule @ 2015-02-19 20:32 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
2015-02-19 19:51 GMT+01:00 David Fetter <[email protected]>:
> On Sun, Feb 01, 2015 at 08:38:24AM +0100, Pavel Stehule wrote:
> > Hi all
> >
> > I am sending a review of this patch:
> >
> > * What it does? - Allow to connect to other db by \connect uri connection
> > format
> >
> > postgres=# \c postgresql://localhost?service=old
> > psql (9.5devel, server 9.2.9)
> > You are now connected to database "postgres" as user "pavel".
> >
> > * Would we this feature? - yes, it eliminate inconsistency between cmd
> line
> > connect and \connect. It is good idea without any objections.
> >
> > * This patch is cleanly applicable, later compilation without any issues
> >
> > * All regress tests passed
> >
> > * A psql documentation is updated -- this feature (and format) is not
> > widely known, so maybe some more examples are welcome
> >
> > * When I tested this feature, it worked as expected
> >
> > * Code respects PostgreSQL coding rules. I prefer a little bit different
> > test if keep password. Current code is little bit harder to understand.
> But
> > I can live with David's code well too.
> >
> > if
> > (!user)
> >
> > user = PQuser(o_conn);
> >
> > if
> > (!host)
> >
> > host =
> > PQhost(o_conn);
> >
> >
> > if
> > (!port)
> >
> > port =
> > PQport(o_conn);
> >
> >
> > if
> > (dbname)
> >
> > has_connection_string =
> > recognized_connection_string(dbname);
> >
> >
> > /* we should not to keep password if some connection property is
> changed
> > */
> >
> >
> > keep_password = strcmp(user, PQuser(o_conn)) == 0 && strcmp(host,
> > PQhost(o_conn)) == 0
> > && strcmp(port, PQport(o_conn)) == 0 &&
> > !has_connection_string;
>
> Changed. This is cleaner.
>
> > I have not any other comments.
> >
> > Possible questions:
> > 1. more examples in doc
>
> I'm not sure how best to illustrate those. Are you thinking of one
> example each for the URI and conninfo cases?
>
some like
"most common form is:
"\c mydb"
but you can use any connection format described
(libpq-connect.html#LIBPQ-PARAMKEYWORDS) like
"\c postgresql://tom@localhost/mydb?application_name=myapp"
>
> > 2. small change how to check keep_password
>
> Done.
>
> Cheers,
> David.
> --
> David Fetter <[email protected]> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: [email protected]
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
@ 2015-02-19 22:33 ` David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
0 siblings, 1 reply; 992+ messages in thread
From: David Fetter @ 2015-02-19 22:33 UTC (permalink / raw)
To: Pavel Stehule <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Thu, Feb 19, 2015 at 09:32:29PM +0100, Pavel Stehule wrote:
> 2015-02-19 19:51 GMT+01:00 David Fetter <[email protected]>:
>
> > On Sun, Feb 01, 2015 at 08:38:24AM +0100, Pavel Stehule wrote:
> >
> > I'm not sure how best to illustrate those. Are you thinking of one
> > example each for the URI and conninfo cases?
> >
>
> some like
>
> "most common form is:
>
> "\c mydb"
>
> but you can use any connection format described
> (libpq-connect.html#LIBPQ-PARAMKEYWORDS) like
>
> "\c postgresql://tom@localhost/mydb?application_name=myapp"
Examples added.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..340a5d5 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +824,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..ec86e52 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/plain] psql_fix_uri_service_006.patch (8.9K, ../../[email protected]/2-psql_fix_uri_service_006.patch)
download | inline diff:
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..340a5d5 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +824,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..ec86e52 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-20 06:10 ` Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
0 siblings, 1 reply; 992+ messages in thread
From: Pavel Stehule @ 2015-02-20 06:10 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
Hi
I am happy with doc changes now.
When I test last patch, I found sigfault bug, because host =
PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
If you are agree with fix, I'll mark this patch as ready for commit.
Regards
Pavel
2015-02-19 23:33 GMT+01:00 David Fetter <[email protected]>:
> On Thu, Feb 19, 2015 at 09:32:29PM +0100, Pavel Stehule wrote:
> > 2015-02-19 19:51 GMT+01:00 David Fetter <[email protected]>:
> >
> > > On Sun, Feb 01, 2015 at 08:38:24AM +0100, Pavel Stehule wrote:
> > >
> > > I'm not sure how best to illustrate those. Are you thinking of one
> > > example each for the URI and conninfo cases?
> > >
> >
> > some like
> >
> > "most common form is:
> >
> > "\c mydb"
> >
> > but you can use any connection format described
> > (libpq-connect.html#LIBPQ-PARAMKEYWORDS) like
> >
> > "\c postgresql://tom@localhost/mydb?application_name=myapp"
>
> Examples added.
>
> Cheers,
> David.
> --
> David Fetter <[email protected]> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: [email protected]
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-patch] psql_fix_uri_service_007.patch (9.1K, ../../CAFj8pRBGqmCh8yFpDKXJgPdZYdaNc1YH44D0VOGnms5hqi9Z5Q@mail.gmail.com/3-psql_fix_uri_service_007.patch)
download | inline diff:
commit f0e71c50590b94da5dafb72a377c7c70b49ce488
Author: root <[email protected]>
Date: Fri Feb 20 07:04:53 2015 +0100
fix segfault due empty variable host
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..340a5d5 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +824,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..dd9350e 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
-
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ int paramnum = 0;
+
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
@ 2015-02-20 07:22 ` David Fetter <[email protected]>
2015-02-20 07:27 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
0 siblings, 2 replies; 992+ messages in thread
From: David Fetter @ 2015-02-20 07:22 UTC (permalink / raw)
To: Pavel Stehule <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Fri, Feb 20, 2015 at 07:10:29AM +0100, Pavel Stehule wrote:
> Hi
>
> I am happy with doc changes now.
>
> When I test last patch, I found sigfault bug, because host =
> PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
>
> If you are agree with fix, I'll mark this patch as ready for commit.
Thanks for fixing the bug. Let's go with this.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-20 07:27 ` Pavel Stehule <[email protected]>
1 sibling, 0 replies; 992+ messages in thread
From: Pavel Stehule @ 2015-02-20 07:27 UTC (permalink / raw)
To: pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, passed
Documentation: tested, passed
no issues with last 007 patch
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-20 07:28 ` Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
1 sibling, 1 reply; 992+ messages in thread
From: Pavel Stehule @ 2015-02-20 07:28 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
2015-02-20 8:22 GMT+01:00 David Fetter <[email protected]>:
> On Fri, Feb 20, 2015 at 07:10:29AM +0100, Pavel Stehule wrote:
> > Hi
> >
> > I am happy with doc changes now.
> >
> > When I test last patch, I found sigfault bug, because host =
> > PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
> >
> > If you are agree with fix, I'll mark this patch as ready for commit.
>
> Thanks for fixing the bug. Let's go with this.
>
marked as "ready for commit"
Thank you for patch
Regards
Pavel
>
> Cheers,
> David.
> --
> David Fetter <[email protected]> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: [email protected]
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
@ 2015-02-20 20:55 ` Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-21 06:04 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
0 siblings, 2 replies; 992+ messages in thread
From: Alvaro Herrera @ 2015-02-20 20:55 UTC (permalink / raw)
To: Pavel Stehule <[email protected]>; +Cc: David Fetter <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
Pavel Stehule wrote:
> 2015-02-20 8:22 GMT+01:00 David Fetter <[email protected]>:
>
> > On Fri, Feb 20, 2015 at 07:10:29AM +0100, Pavel Stehule wrote:
> > > Hi
> > >
> > > I am happy with doc changes now.
> > >
> > > When I test last patch, I found sigfault bug, because host =
> > > PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
> > >
> > > If you are agree with fix, I'll mark this patch as ready for commit.
> >
> > Thanks for fixing the bug. Let's go with this.
> >
>
> marked as "ready for commit"
Gave this patch a look. In general it looks pretty good, but there is
one troublesome point: it duplicates two functions from libpq into psql,
including the URI designators. This doesn't look very nice. I thought
about just creating a new src/common (say connstring.c) to host those
two functions and the URI designators, but then on closer look I noticed
that libpq's facilities for URI parsing become severed: two very small
functions become part of libpgcommon, while the more complex parts
remain in libpq.
On the other hand, if we see that psql needs this functionality, isn't
this a clue that other client programs might find it useful too?
(Honestly I'm not completely sure about this point -- other opinions?)
I see three[four] ways forward from here:
1. export this functionality in libpq as one or two new functions. This
would need proper docs, exports.txt, etc.
2. export it in libpgcommon. If we choose this option we should
probably rename those functions, as in the attached patch.
3. accept the patch as is, i.e. duplicate the libq-internal functions in
psql.
[4. reject the whole thing]
I lean towards (2) myself, but what do others think?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-diff] psql_fix_uri_service_008.patch (14.7K, ../../[email protected]/2-psql_fix_uri_service_008.patch)
download | inline diff:
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..173b6c3 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,21 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string } ] </literal></term>
+ <term><literal>\connect [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +825,22 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs, and URIs:
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 4201956..64210bf 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -31,6 +31,7 @@
#include <sys/stat.h> /* for stat() */
#endif
+#include "common/connstrings.h"
#include "portability/instr_time.h"
#include "libpq-fe.h"
@@ -1608,6 +1609,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1621,15 +1624,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = libpq_connstring_is_recognized(dbname);
+
+ keep_password =
+ ((strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't trigger
+ * throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1644,9 +1663,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1654,23 +1677,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
-
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ int paramnum = 0;
+
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5ddd654..7f0be95 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -52,6 +52,7 @@
#include "libpq-fe.h"
#include "pqexpbuffer.h"
#include "common.h"
+#include "common/connstrings.h"
#include "settings.h"
#include "stringutils.h"
@@ -69,6 +70,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3714,10 +3719,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (libpq_connstring_is_recognized(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (libpq_connstring_is_recognized(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
diff --git a/src/common/Makefile b/src/common/Makefile
index 372a21b..d1338c1 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -26,7 +26,7 @@ LIBS += $(PTHREAD_LIBS)
OBJS_COMMON = exec.o pg_crc.o pg_lzcompress.o pgfnames.o psprintf.o relpath.o \
rmtree.o string.o username.o wait_error.o
-OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o
+OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o connstrings.o
OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
diff --git a/src/common/connstrings.c b/src/common/connstrings.c
new file mode 100644
index 0000000..aa5fdb0
--- /dev/null
+++ b/src/common/connstrings.c
@@ -0,0 +1,51 @@
+/*
+ * connstrings.c
+ * connecting string related functions
+ *
+ * Copyright (c) 2012-2015, PostgreSQL Global Development Group
+ *
+ * src/include/common/connstrings.c
+ */
+#include "postgres_fe.h"
+
+#include <string.h>
+
+#include "common/connstrings.h"
+
+
+/* The connection URI must start with either of the following designators: */
+static const char uri_designator[] = "postgresql://";
+static const char short_uri_designator[] = "postgres://";
+
+/*
+ * Checks if the given connection string starts with either of the valid URI
+ * prefix designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ */
+int
+libpq_connstring_uri_prefix_length(const char *connstr)
+{
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * Must be consistent with libpq's parse_connection_string: anything for which
+ * this returns true should at least look like it's parseable by that routine.
+ */
+bool
+libpq_connstring_is_recognized(const char *connstr)
+{
+ return libpq_connstring_uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
diff --git a/src/include/common/connstrings.h b/src/include/common/connstrings.h
new file mode 100644
index 0000000..1fe624e
--- /dev/null
+++ b/src/include/common/connstrings.h
@@ -0,0 +1,16 @@
+/*
+ * connstrings.h
+ * connecting string related prototypes
+ *
+ * Copyright (c) 2012-2015, PostgreSQL Global Development Group
+ *
+ * src/include/common/connstrings.h
+ */
+#ifndef CONNSTRINGS_H
+#define CONNSTRINGS_H
+
+
+extern int libpq_connstring_uri_prefix_length(const char *connstr);
+extern bool libpq_connstring_is_recognized(const char *connstr);
+
+#endif /* CONNSTRINGS_H */
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 25961b1..e5407dd 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -22,6 +22,7 @@
#include <time.h>
#include <unistd.h>
+#include "common/connstrings.h"
#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"
@@ -339,8 +340,6 @@ static void closePGconn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
static PQconninfoOption *parse_connection_string(const char *conninfo,
PQExpBuffer errorMessage, bool use_defaults);
-static int uri_prefix_length(const char *connstr);
-static bool recognized_connection_string(const char *connstr);
static PQconninfoOption *conninfo_parse(const char *conninfo,
PQExpBuffer errorMessage, bool use_defaults);
static PQconninfoOption *conninfo_array_parse(const char *const * keywords,
@@ -971,7 +970,7 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
* If the dbName parameter contains what looks like a connection string,
* parse it into conn struct using connectOptions1.
*/
- if (dbName && recognized_connection_string(dbName))
+ if (dbName && libpq_connstring_is_recognized(dbName))
{
if (!connectOptions1(conn, dbName))
return conn;
@@ -4179,13 +4178,15 @@ conninfo_init(PQExpBuffer errorMessage)
*
* If use_defaults is TRUE, default values are filled in (from a service file,
* environment variables, etc).
+ *
+ * Make sure to keep libpq_connstring_is_recognized in sync with this.
*/
static PQconninfoOption *
parse_connection_string(const char *connstr, PQExpBuffer errorMessage,
bool use_defaults)
{
/* Parse as URI if connection string matches URI prefix */
- if (uri_prefix_length(connstr) != 0)
+ if (libpq_connstring_uri_prefix_length(connstr) != 0)
return conninfo_uri_parse(connstr, errorMessage, use_defaults);
/* Parse as default otherwise */
@@ -4193,39 +4194,6 @@ parse_connection_string(const char *connstr, PQExpBuffer errorMessage,
}
/*
- * Checks if connection string starts with either of the valid URI prefix
- * designators.
- *
- * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
- */
-static int
-uri_prefix_length(const char *connstr)
-{
- if (strncmp(connstr, uri_designator,
- sizeof(uri_designator) - 1) == 0)
- return sizeof(uri_designator) - 1;
-
- if (strncmp(connstr, short_uri_designator,
- sizeof(short_uri_designator) - 1) == 0)
- return sizeof(short_uri_designator) - 1;
-
- return 0;
-}
-
-/*
- * Recognized connection string either starts with a valid URI prefix or
- * contains a "=" in it.
- *
- * Must be consistent with parse_connection_string: anything for which this
- * returns true should at least look like it's parseable by that routine.
- */
-static bool
-recognized_connection_string(const char *connstr)
-{
- return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
-}
-
-/*
* Subroutine for parse_connection_string
*
* Deal with a string containing key=value pairs.
@@ -4400,7 +4368,7 @@ conninfo_parse(const char *conninfo, PQExpBuffer errorMessage,
*
* If expand_dbname is non-zero, and the value passed for the first occurrence
* of "dbname" keyword is a connection string (as indicated by
- * recognized_connection_string) then parse and process it, overriding any
+ * libpq_connstring_is_recognized) then parse and process it, overriding any
* previously processed conflicting keywords. Subsequent keywords will take
* precedence, however.
*/
@@ -4431,7 +4399,7 @@ conninfo_array_parse(const char *const * keywords, const char *const * values,
* defaults here -- those get picked up later. We only want to
* override for those parameters actually passed.
*/
- if (recognized_connection_string(pvalue))
+ if (libpq_connstring_is_recognized(pvalue))
{
dbname_options = parse_connection_string(pvalue, errorMessage, false);
if (dbname_options == NULL)
@@ -4722,7 +4690,7 @@ conninfo_uri_parse_options(PQconninfoOption *options, const char *uri,
start = buf;
/* Skip the URI prefix */
- prefix_len = uri_prefix_length(uri);
+ prefix_len = libpq_connstring_uri_prefix_length(uri);
if (prefix_len == 0)
{
/* Should never happen */
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-02-20 21:08 ` David Fetter <[email protected]>
2015-02-20 21:25 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
1 sibling, 2 replies; 992+ messages in thread
From: David Fetter @ 2015-02-20 21:08 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Fri, Feb 20, 2015 at 05:55:20PM -0300, Alvaro Herrera wrote:
> Pavel Stehule wrote:
> > 2015-02-20 8:22 GMT+01:00 David Fetter <[email protected]>:
> >
> > > On Fri, Feb 20, 2015 at 07:10:29AM +0100, Pavel Stehule wrote:
> > > > Hi
> > > >
> > > > I am happy with doc changes now.
> > > >
> > > > When I test last patch, I found sigfault bug, because host =
> > > > PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
> > > >
> > > > If you are agree with fix, I'll mark this patch as ready for commit.
> > >
> > > Thanks for fixing the bug. Let's go with this.
> > >
> >
> > marked as "ready for commit"
>
> Gave this patch a look. In general it looks pretty good, but there is
> one troublesome point: it duplicates two functions from libpq into psql,
> including the URI designators. This doesn't look very nice.
My thinking behind this was that the patch is a bug fix and intended
to be back-patched, so I wanted to mess with as little infrastructure
as possible. A new version of libpq seems like a very big ask for
such a case. You'll recall that the original problem was that
\c service=foo
only worked accidentally for some pretty narrow use cases and broke
without much of a clue for the rest. It turned out that the general
problem was that options given to psql on the command line were not
even remotely equivalent to \c, even though they were documented to
be.
> I thought about just creating a new src/common (say connstring.c) to
> host those two functions and the URI designators, but then on closer
> look I noticed that libpq's facilities for URI parsing become
> severed: two very small functions become part of libpgcommon, while
> the more complex parts remain in libpq.
Right.
> On the other hand, if we see that psql needs this functionality, isn't
> this a clue that other client programs might find it useful too?
> (Honestly I'm not completely sure about this point -- other opinions?)
It might well.
> I see three[four] ways forward from here:
>
> 1. export this functionality in libpq as one or two new functions. This
> would need proper docs, exports.txt, etc.
That sounds like a great thing going forward.
> 2. export it in libpgcommon. If we choose this option we should
> probably rename those functions, as in the attached patch.
I'm not super attached to the names.
> 3. accept the patch as is, i.e. duplicate the libq-internal functions in
> psql.
Again, my chief concern was to produce a back-patchable bug fix. The
internal functions could be in the going-backward versions, and the
shared ones in the going-forward (9.5+) versions.
> [4. reject the whole thing]
>
> I lean towards (2) myself, but what do others think?
Obviously, I'm biased, as the original impulse to fix this bug was
mine.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-20 21:25 ` Alvaro Herrera <[email protected]>
2015-02-21 06:17 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
1 sibling, 1 reply; 992+ messages in thread
From: Alvaro Herrera @ 2015-02-20 21:25 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
David Fetter wrote:
> On Fri, Feb 20, 2015 at 05:55:20PM -0300, Alvaro Herrera wrote:
> > Gave this patch a look. In general it looks pretty good, but there is
> > one troublesome point: it duplicates two functions from libpq into psql,
> > including the URI designators. This doesn't look very nice.
>
> My thinking behind this was that the patch is a bug fix and intended
> to be back-patched, so I wanted to mess with as little infrastructure
> as possible.
Oh, so this is to be backpatched? Yeah, I guess in the backbranch case
it's acceptable to duplicate some bits, but I don't think this gives us
blanket permission to do it in master. So we need two versions of the
patch.
> > 2. export it in libpgcommon. If we choose this option we should
> > probably rename those functions, as in the attached patch.
>
> I'm not super attached to the names.
Me neither. Suggestions welcome.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 21:25 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-02-21 06:17 ` Pavel Stehule <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Pavel Stehule @ 2015-02-21 06:17 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: David Fetter <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
2015-02-20 22:25 GMT+01:00 Alvaro Herrera <[email protected]>:
> David Fetter wrote:
> > On Fri, Feb 20, 2015 at 05:55:20PM -0300, Alvaro Herrera wrote:
>
> > > Gave this patch a look. In general it looks pretty good, but there is
> > > one troublesome point: it duplicates two functions from libpq into
> psql,
> > > including the URI designators. This doesn't look very nice.
> >
> > My thinking behind this was that the patch is a bug fix and intended
> > to be back-patched, so I wanted to mess with as little infrastructure
> > as possible.
>
> Oh, so this is to be backpatched? Yeah, I guess in the backbranch case
> it's acceptable to duplicate some bits, but I don't think this gives us
> blanket permission to do it in master. So we need two versions of the
> patch.
>
> > > 2. export it in libpgcommon. If we choose this option we should
> > > probably rename those functions, as in the attached patch.
> >
> > I'm not super attached to the names.
>
> Me neither. Suggestions welcome.
>
I have not any problem with these names - it is related what it does.
"libpq_connstring_uri_prefix_length" is 100% correct
"libpq_connstring_is_recognized" is correct too .. the name is maybe long,
but this functions are not used 100x per day
Regards
Pavel
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-23 20:56 ` Alvaro Herrera <[email protected]>
2015-02-23 21:02 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-27 16:42 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-03-02 21:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
1 sibling, 3 replies; 992+ messages in thread
From: Alvaro Herrera @ 2015-02-23 20:56 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
David Fetter wrote:
> My thinking behind this was that the patch is a bug fix and intended
> to be back-patched, so I wanted to mess with as little infrastructure
> as possible. A new version of libpq seems like a very big ask for
> such a case. You'll recall that the original problem was that
>
> \c service=foo
>
> only worked accidentally for some pretty narrow use cases and broke
> without much of a clue for the rest. It turned out that the general
> problem was that options given to psql on the command line were not
> even remotely equivalent to \c, even though they were documented to
> be.
So, in view of these arguments and those put forward by Pavel
downthread, I think the attached is an acceptable patch for the master
branch. It doesn't apply to back branches though; 9.4 and 9.3 have a
conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
and 9.1 and 9.0 are problematic all over because they don't have
src/common. Could you please submit patches adapted for each group of
branches?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-diff] psql_fix_uri_service_009.patch (0B, ../../[email protected]/2-psql_fix_uri_service_009.patch)
download
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-02-23 21:02 ` Alvaro Herrera <[email protected]>
2 siblings, 0 replies; 992+ messages in thread
From: Alvaro Herrera @ 2015-02-23 21:02 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
Here's the real attachment. Previous one was a misguided shell
redirection. Meh.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-diff] psql_fix_uri_service_009.patch (13.1K, ../../[email protected]/2-psql_fix_uri_service_009.patch)
download | inline diff:
From 830d41b9d23716af29491cbab59808c35e25ec12 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <[email protected]>
Date: Fri, 20 Feb 2015 14:36:41 -0300
Subject: [PATCH] Fix psql's \c to work with URIs and conninfo strings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This makes it more consistent with what can be given in the command
line.
Authors: Andrew Dunstan, David Fetter, Andrew Gierth, Pavel Stěhule
---
doc/src/sgml/ref/psql-ref.sgml | 30 ++++++++++++++---
src/bin/psql/command.c | 69 +++++++++++++++++++++++++++------------
src/bin/psql/tab-complete.c | 20 ++++++++++--
src/common/Makefile | 2 +-
src/common/connstrings.c | 52 +++++++++++++++++++++++++++++
src/include/common/connstrings.h | 16 +++++++++
src/interfaces/libpq/fe-connect.c | 36 +-------------------
7 files changed, 162 insertions(+), 63 deletions(-)
create mode 100644 src/common/connstrings.c
create mode 100644 src/include/common/connstrings.h
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..a218af8 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,23 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string } ] </literal></term>
+ <term><literal>\connect [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>.
+ If the new connection is successfully made, the
+ previous connection is closed.
+ When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used.
+ If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +827,23 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING">
+ takes two forms: keyword-value pairs, and URIs:
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..7d8d5bb 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password =
+ ((strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't trigger
+ * throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
-
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ int paramnum = 0;
+
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
diff --git a/src/common/Makefile b/src/common/Makefile
index 372a21b..d1338c1 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -26,7 +26,7 @@ LIBS += $(PTHREAD_LIBS)
OBJS_COMMON = exec.o pg_crc.o pg_lzcompress.o pgfnames.o psprintf.o relpath.o \
rmtree.o string.o username.o wait_error.o
-OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o
+OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o connstrings.o
OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
diff --git a/src/common/connstrings.c b/src/common/connstrings.c
new file mode 100644
index 0000000..4a49179
--- /dev/null
+++ b/src/common/connstrings.c
@@ -0,0 +1,52 @@
+/*
+ * connstrings.c
+ * connecting string processing functions
+ *
+ * Copyright (c) 2012-2015, PostgreSQL Global Development Group
+ *
+ * src/include/common/connstrings.c
+ */
+#include "postgres_fe.h"
+
+#include <string.h>
+
+#include "common/connstrings.h"
+
+
+/* The connection URI must start with either of the following designators: */
+static const char uri_designator[] = "postgresql://";
+static const char short_uri_designator[] = "postgres://";
+
+
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ */
+int
+uri_prefix_length(const char *connstr)
+{
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * Must be consistent with parse_connection_string: anything for which this
+ * returns true should at least look like it's parseable by that routine.
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
diff --git a/src/include/common/connstrings.h b/src/include/common/connstrings.h
new file mode 100644
index 0000000..5644bbe
--- /dev/null
+++ b/src/include/common/connstrings.h
@@ -0,0 +1,16 @@
+/*
+ * connstrings.h
+ * connecting string processing prototypes
+ *
+ * Copyright (c) 2012-2015, PostgreSQL Global Development Group
+ *
+ * src/include/common/connstrings.h
+ */
+#ifndef CONNSTRINGS_H
+#define CONNSTRINGS_H
+
+
+extern int uri_prefix_length(const char *connstr);
+extern bool recognized_connection_string(const char *connstr);
+
+#endif /* CONNSTRINGS_H */
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index e2a06b3..cc14e4e 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -22,6 +22,7 @@
#include <time.h>
#include <unistd.h>
+#include "common/connstrings.h"
#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"
@@ -339,8 +340,6 @@ static void closePGconn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
static PQconninfoOption *parse_connection_string(const char *conninfo,
PQExpBuffer errorMessage, bool use_defaults);
-static int uri_prefix_length(const char *connstr);
-static bool recognized_connection_string(const char *connstr);
static PQconninfoOption *conninfo_parse(const char *conninfo,
PQExpBuffer errorMessage, bool use_defaults);
static PQconninfoOption *conninfo_array_parse(const char *const * keywords,
@@ -4193,39 +4192,6 @@ parse_connection_string(const char *connstr, PQExpBuffer errorMessage,
}
/*
- * Checks if connection string starts with either of the valid URI prefix
- * designators.
- *
- * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
- */
-static int
-uri_prefix_length(const char *connstr)
-{
- if (strncmp(connstr, uri_designator,
- sizeof(uri_designator) - 1) == 0)
- return sizeof(uri_designator) - 1;
-
- if (strncmp(connstr, short_uri_designator,
- sizeof(short_uri_designator) - 1) == 0)
- return sizeof(short_uri_designator) - 1;
-
- return 0;
-}
-
-/*
- * Recognized connection string either starts with a valid URI prefix or
- * contains a "=" in it.
- *
- * Must be consistent with parse_connection_string: anything for which this
- * returns true should at least look like it's parseable by that routine.
- */
-static bool
-recognized_connection_string(const char *connstr)
-{
- return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
-}
-
-/*
* Subroutine for parse_connection_string
*
* Deal with a string containing key=value pairs.
--
2.1.4
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-02-27 16:42 ` David Fetter <[email protected]>
2015-02-27 17:51 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-20 12:43 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2 siblings, 2 replies; 992+ messages in thread
From: David Fetter @ 2015-02-27 16:42 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Mon, Feb 23, 2015 at 05:56:12PM -0300, Alvaro Herrera wrote:
>
> David Fetter wrote:
>
> > My thinking behind this was that the patch is a bug fix and intended
> > to be back-patched, so I wanted to mess with as little infrastructure
> > as possible. A new version of libpq seems like a very big ask for
> > such a case. You'll recall that the original problem was that
> >
> > \c service=foo
> >
> > only worked accidentally for some pretty narrow use cases and broke
> > without much of a clue for the rest. It turned out that the general
> > problem was that options given to psql on the command line were not
> > even remotely equivalent to \c, even though they were documented to
> > be.
>
> So, in view of these arguments and those put forward by Pavel
> downthread, I think the attached is an acceptable patch for the master
> branch. It doesn't apply to back branches though; 9.4 and 9.3 have a
> conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
> and 9.1 and 9.0 are problematic all over because they don't have
> src/common. Could you please submit patches adapted for each group of
> branches?
Please find patches attached for each live branch.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
From 64c7d3bcfad80dc80857b2ea06c9f2b7fff8f2a5 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
Resolved conflicts:
src/bin/psql/command.c
Resolved conflicts:
doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/command.c
---
doc/src/sgml/ref/psql-ref.sgml | 61 ++++++++++++++++++++++-----------
src/bin/psql/command.c | 77 ++++++++++++++++++++++++++++++++----------
src/bin/psql/common.c | 36 ++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 ++++++-
5 files changed, 150 insertions(+), 38 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 15bbd7a..b7f0601 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -751,33 +751,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\C [ <replaceable class="parameter">title</replaceable> ]</literal></term>
- <listitem>
- <para>
- Sets the title of any tables being printed as the result of a
- query or unset any such title. This command is equivalent to
- <literal>\pset title <replaceable
- class="parameter">title</replaceable></literal>. (The name of
- this command derives from <quote>caption</quote>, as it was
- previously only used to set the caption in an
- <acronym>HTML</acronym> table.)
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>\connect</literal> (or <literal>\c</literal>) <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -792,6 +779,42 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>\C [ <replaceable class="parameter">title</replaceable> ]</literal></term>
+ <listitem>
+ <para>
+ Sets the title of any tables being printed as the result of a
+ query or unset any such title. This command is equivalent to
+ <literal>\pset title <replaceable
+ class="parameter">title</replaceable></literal>. (The name of
+ this command derives from <quote>caption</quote>, as it was
+ previously only used to set the caption in an
+ <acronym>HTML</acronym> table.)
+ </para>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index d2967ed..49c20bd 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1240,16 +1240,46 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
+
+ if (!o_conn && (!dbname || !user || !host || !port))
+ {
+ /*
+ * We don't know the supplied connection parameters and don't want to
+ * connect to the wrong database by using defaults, so require all
+ * parameters to be specified.
+ */
+ psql_error("All connection parameters must be supplied because no "
+ "database connection exists\n");
+ return false;
+ }
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1264,9 +1294,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1274,21 +1308,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 7
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 5013ad3..6938d08 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1514,6 +1514,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index 838a552..155771c 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -63,4 +63,6 @@ extern const char *session_username(void);
extern char *expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index feeb76f..98e23b9 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -2451,7 +2455,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
From 968ca9febefe48b2424049a21a9cf51b331defcd Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
Resolved conflicts:
src/bin/psql/command.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++---
src/bin/psql/command.c | 79 +++++++++++++++++++++++++++++++-----------
src/bin/psql/common.c | 36 +++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 ++++++-
5 files changed, 135 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 6b64cd5..54bde8d 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -745,18 +745,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -771,6 +773,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index fdb2404..adfc60f 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1467,16 +1467,46 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
+
+ if (!o_conn && (!dbname || !user || !host || !port))
+ {
+ /*
+ * We don't know the supplied connection parameters and don't want to
+ * connect to the wrong database by using defaults, so require all
+ * parameters to be specified.
+ */
+ psql_error("All connection parameters must be supplied because no "
+ "database connection exists\n");
+ return false;
+ }
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1491,9 +1521,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1501,23 +1535,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index abb1082..82f2320 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1514,6 +1514,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index a26b868..20951d7 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -63,4 +63,6 @@ extern const char *session_username(void);
extern char *expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index d90d281..b5316fa 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -2776,7 +2780,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
From 8c21e0d49c0ce8c4b21bd14d13b681f9148d68da Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
Resolved conflicts:
src/bin/psql/command.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++---
src/bin/psql/command.c | 79 +++++++++++++++++++++++++++++++-----------
src/bin/psql/common.c | 36 +++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 ++++++-
5 files changed, 135 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 9d9c573..7d741ed 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -771,18 +771,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -797,6 +799,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b74db20..5a8b24d 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1506,16 +1506,46 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
+
+ if (!o_conn && (!dbname || !user || !host || !port))
+ {
+ /*
+ * We don't know the supplied connection parameters and don't want to
+ * connect to the wrong database by using defaults, so require all
+ * parameters to be specified.
+ */
+ psql_error("All connection parameters must be supplied because no "
+ "database connection exists\n");
+ return false;
+ }
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1530,9 +1560,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1540,23 +1574,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 49ee47a..8b13a8f 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1626,6 +1626,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index cfe0dad..7364908 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -63,4 +63,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 870dd6f..ae55189 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -2938,7 +2942,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
From 2ab01b469297e0dd0eeae8b227924667e9aad814 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++++---
src/bin/psql/command.c | 67 +++++++++++++++++++++++++++++-------------
src/bin/psql/common.c | 36 +++++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 +++++++-
5 files changed, 123 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index ca1daea..a8403cb 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -772,18 +772,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -798,6 +800,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 0152a76..8786a1a 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1559,6 +1559,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1572,15 +1574,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1595,9 +1613,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1605,23 +1627,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 6f16a5c..2d98d44 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1654,6 +1654,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index db645da..dd2fdcf 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -46,4 +46,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 0a210cb..a4e5a6e 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3256,7 +3260,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
From 86f7d6549dc74c1baa58cf9d66f2f2cf4df32666 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++++---
src/bin/psql/command.c | 67 +++++++++++++++++++++++++++++-------------
src/bin/psql/common.c | 36 +++++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 +++++++-
5 files changed, 123 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 1d034df..d985201 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -778,18 +778,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -804,6 +806,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 8f8c785..391f60b 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1595,6 +1595,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1608,15 +1610,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1631,9 +1649,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1641,23 +1663,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index c08c813..da4f414 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1691,6 +1691,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index f58c545..069c1b8 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -46,4 +46,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 9841c1a..3e51ecb 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3413,7 +3417,13 @@ psql_completion(const char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
From 1fcca51973cdd91b1620fdf6502f658f6b557c16 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++++---
src/bin/psql/command.c | 67 +++++++++++++++++++++++++++++-------------
src/bin/psql/common.c | 36 +++++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 20 +++++++++++--
5 files changed, 130 insertions(+), 26 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..340a5d5 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +824,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..dd9350e 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/plain] psql_fix_uri_service_90_010.patch (10.7K, ../../[email protected]/2-psql_fix_uri_service_90_010.patch)
download | inline diff:
From 64c7d3bcfad80dc80857b2ea06c9f2b7fff8f2a5 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
Resolved conflicts:
src/bin/psql/command.c
Resolved conflicts:
doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/command.c
---
doc/src/sgml/ref/psql-ref.sgml | 61 ++++++++++++++++++++++-----------
src/bin/psql/command.c | 77 ++++++++++++++++++++++++++++++++----------
src/bin/psql/common.c | 36 ++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 ++++++-
5 files changed, 150 insertions(+), 38 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 15bbd7a..b7f0601 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -751,33 +751,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\C [ <replaceable class="parameter">title</replaceable> ]</literal></term>
- <listitem>
- <para>
- Sets the title of any tables being printed as the result of a
- query or unset any such title. This command is equivalent to
- <literal>\pset title <replaceable
- class="parameter">title</replaceable></literal>. (The name of
- this command derives from <quote>caption</quote>, as it was
- previously only used to set the caption in an
- <acronym>HTML</acronym> table.)
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>\connect</literal> (or <literal>\c</literal>) <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -792,6 +779,42 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>\C [ <replaceable class="parameter">title</replaceable> ]</literal></term>
+ <listitem>
+ <para>
+ Sets the title of any tables being printed as the result of a
+ query or unset any such title. This command is equivalent to
+ <literal>\pset title <replaceable
+ class="parameter">title</replaceable></literal>. (The name of
+ this command derives from <quote>caption</quote>, as it was
+ previously only used to set the caption in an
+ <acronym>HTML</acronym> table.)
+ </para>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index d2967ed..49c20bd 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1240,16 +1240,46 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
+
+ if (!o_conn && (!dbname || !user || !host || !port))
+ {
+ /*
+ * We don't know the supplied connection parameters and don't want to
+ * connect to the wrong database by using defaults, so require all
+ * parameters to be specified.
+ */
+ psql_error("All connection parameters must be supplied because no "
+ "database connection exists\n");
+ return false;
+ }
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1264,9 +1294,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1274,21 +1308,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 7
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = NULL;
- values[6] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 5013ad3..6938d08 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1514,6 +1514,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index 838a552..155771c 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -63,4 +63,6 @@ extern const char *session_username(void);
extern char *expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index feeb76f..98e23b9 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -2451,7 +2455,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
[text/plain] psql_fix_uri_service_91_010.patch (9.5K, ../../[email protected]/3-psql_fix_uri_service_91_010.patch)
download | inline diff:
From 968ca9febefe48b2424049a21a9cf51b331defcd Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
Resolved conflicts:
src/bin/psql/command.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++---
src/bin/psql/command.c | 79 +++++++++++++++++++++++++++++++-----------
src/bin/psql/common.c | 36 +++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 ++++++-
5 files changed, 135 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 6b64cd5..54bde8d 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -745,18 +745,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -771,6 +773,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index fdb2404..adfc60f 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1467,16 +1467,46 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
+
+ if (!o_conn && (!dbname || !user || !host || !port))
+ {
+ /*
+ * We don't know the supplied connection parameters and don't want to
+ * connect to the wrong database by using defaults, so require all
+ * parameters to be specified.
+ */
+ psql_error("All connection parameters must be supplied because no "
+ "database connection exists\n");
+ return false;
+ }
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1491,9 +1521,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1501,23 +1535,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index abb1082..82f2320 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1514,6 +1514,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index a26b868..20951d7 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -63,4 +63,6 @@ extern const char *session_username(void);
extern char *expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index d90d281..b5316fa 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -2776,7 +2780,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
[text/plain] psql_fix_uri_service_92_010.patch (9.5K, ../../[email protected]/4-psql_fix_uri_service_92_010.patch)
download | inline diff:
From 8c21e0d49c0ce8c4b21bd14d13b681f9148d68da Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
Resolved conflicts:
src/bin/psql/command.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++---
src/bin/psql/command.c | 79 +++++++++++++++++++++++++++++++-----------
src/bin/psql/common.c | 36 +++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 ++++++-
5 files changed, 135 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 9d9c573..7d741ed 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -771,18 +771,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -797,6 +799,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b74db20..5a8b24d 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1506,16 +1506,46 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
+
+ if (!o_conn && (!dbname || !user || !host || !port))
+ {
+ /*
+ * We don't know the supplied connection parameters and don't want to
+ * connect to the wrong database by using defaults, so require all
+ * parameters to be specified.
+ */
+ psql_error("All connection parameters must be supplied because no "
+ "database connection exists\n");
+ return false;
+ }
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1530,9 +1560,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1540,23 +1574,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 49ee47a..8b13a8f 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1626,6 +1626,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index cfe0dad..7364908 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -63,4 +63,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 870dd6f..ae55189 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -2938,7 +2942,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
[text/plain] psql_fix_uri_service_93_010.patch (9.2K, ../../[email protected]/5-psql_fix_uri_service_93_010.patch)
download | inline diff:
From 2ab01b469297e0dd0eeae8b227924667e9aad814 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++++---
src/bin/psql/command.c | 67 +++++++++++++++++++++++++++++-------------
src/bin/psql/common.c | 36 +++++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 +++++++-
5 files changed, 123 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index ca1daea..a8403cb 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -772,18 +772,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -798,6 +800,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 0152a76..8786a1a 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1559,6 +1559,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1572,15 +1574,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1595,9 +1613,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1605,23 +1627,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 6f16a5c..2d98d44 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1654,6 +1654,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index db645da..dd2fdcf 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -46,4 +46,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 0a210cb..a4e5a6e 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3256,7 +3260,13 @@ psql_completion(char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
[text/plain] psql_fix_uri_service_94_010.patch (9.2K, ../../[email protected]/6-psql_fix_uri_service_94_010.patch)
download | inline diff:
From 86f7d6549dc74c1baa58cf9d66f2f2cf4df32666 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
Resolved conflicts:
src/bin/psql/tab-complete.c
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++++---
src/bin/psql/command.c | 67 +++++++++++++++++++++++++++++-------------
src/bin/psql/common.c | 36 +++++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 12 +++++++-
5 files changed, 123 insertions(+), 25 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 1d034df..d985201 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -778,18 +778,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -804,6 +806,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 8f8c785..391f60b 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1595,6 +1595,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1608,15 +1610,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1631,9 +1649,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1641,23 +1663,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index c08c813..da4f414 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1691,6 +1691,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index f58c545..069c1b8 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -46,4 +46,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 9841c1a..3e51ecb 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3413,7 +3417,13 @@ psql_completion(const char *text, int start, int end)
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
[text/plain] psql_fix_uri_service_95_010.patch (9.5K, ../../[email protected]/7-psql_fix_uri_service_95_010.patch)
download | inline diff:
From 1fcca51973cdd91b1620fdf6502f658f6b557c16 Mon Sep 17 00:00:00 2001
From: David Fetter <[email protected]>
Date: Wed, 25 Feb 2015 13:51:17 -0800
Subject: [PATCH] From Alvaro Herrera
---
doc/src/sgml/ref/psql-ref.sgml | 31 ++++++++++++++++---
src/bin/psql/command.c | 67 +++++++++++++++++++++++++++++-------------
src/bin/psql/common.c | 36 +++++++++++++++++++++++
src/bin/psql/common.h | 2 ++
src/bin/psql/tab-complete.c | 20 +++++++++++--
5 files changed, 130 insertions(+), 26 deletions(-)
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a637001..340a5d5 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -796,18 +796,20 @@ testdb=>
</varlistentry>
<varlistentry>
- <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
+ <term><literal>\c</literal> or <literal>\connect</literal> <literal> [ { [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> string | <replaceable class="parameter">URI</replaceable> } ] </literal></term>
<listitem>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
- server. If the new connection is successfully made, the
- previous connection is closed. If any of <replaceable
+ server using positional parameters as described below, a
+ <parameter>conninfo</parameter> string, or a <acronym>URI</acronym>. If the new connection is
+ successfully made, the
+ previous connection is closed. When using positional parameters, if any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
- previous connection is used. If there is no previous
+ previous connection is used. If using positional parameters and there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para>
@@ -822,6 +824,27 @@ testdb=>
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para>
+
+ <para>
+ Positional syntax:
+<programlisting>
+=> \c mydb myuser host.dom 6432
+</programlisting>
+ </para>
+
+ <para>
+ The conninfo form detailed in <xref linkend="LIBPQ-CONNSTRING"> takes two forms: keyword-value pairs
+ </para>
+<programlisting>
+=> \c service=foo
+=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
+</programlisting>
+ <para>
+ and URIs:
+ </para>
+<programlisting>
+=> \c postgresql://tom@localhost/mydb?application_name=myapp
+</programlisting>
</listitem>
</varlistentry>
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 7c9f28d..dd9350e 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1607,6 +1607,8 @@ do_connect(char *dbname, char *user, char *host, char *port)
PGconn *o_conn = pset.db,
*n_conn;
char *password = NULL;
+ bool keep_password = true;
+ bool has_connection_string = false;
if (!o_conn && (!dbname || !user || !host || !port))
{
@@ -1620,15 +1622,31 @@ do_connect(char *dbname, char *user, char *host, char *port)
return false;
}
- if (!dbname)
- dbname = PQdb(o_conn);
if (!user)
user = PQuser(o_conn);
+
if (!host)
host = PQhost(o_conn);
+
if (!port)
port = PQport(o_conn);
+ if (dbname)
+ has_connection_string = recognized_connection_string(dbname);
+
+ keep_password = (
+ (strcmp(user, PQuser(o_conn)) == 0) &&
+ (!host || strcmp(host, PQhost(o_conn)) == 0) &&
+ (strcmp(port, PQport(o_conn)) == 0) &&
+ !has_connection_string);
+
+ /*
+ * Unlike the previous stanzas, changing only the dbname shouldn't
+ * trigger throwing away the password.
+ */
+ if (!dbname)
+ dbname = PQdb(o_conn);
+
/*
* If the user asked to be prompted for a password, ask for one now. If
* not, use the password from the old connection, provided the username
@@ -1643,9 +1661,13 @@ do_connect(char *dbname, char *user, char *host, char *port)
{
password = prompt_for_password(user);
}
- else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
+ else if (o_conn && keep_password)
{
- password = pg_strdup(PQpass(o_conn));
+ password = PQpass(o_conn);
+ if (password && *password)
+ password = pg_strdup(password);
+ else
+ password = NULL;
}
while (true)
@@ -1653,23 +1675,28 @@ do_connect(char *dbname, char *user, char *host, char *port)
#define PARAMS_ARRAY_SIZE 8
const char **keywords = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*keywords));
const char **values = pg_malloc(PARAMS_ARRAY_SIZE * sizeof(*values));
+ int paramnum = 0;
- keywords[0] = "host";
- values[0] = host;
- keywords[1] = "port";
- values[1] = port;
- keywords[2] = "user";
- values[2] = user;
- keywords[3] = "password";
- values[3] = password;
- keywords[4] = "dbname";
- values[4] = dbname;
- keywords[5] = "fallback_application_name";
- values[5] = pset.progname;
- keywords[6] = "client_encoding";
- values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
- keywords[7] = NULL;
- values[7] = NULL;
+ keywords[0] = "dbname";
+ values[0] = dbname;
+
+ if (!has_connection_string)
+ {
+ keywords[++paramnum] = "host";
+ values[paramnum] = host;
+ keywords[++paramnum] = "port";
+ values[paramnum] = port;
+ keywords[++paramnum] = "user";
+ values[paramnum] = user;
+ }
+ keywords[++paramnum] = "password";
+ values[paramnum] = password;
+ keywords[++paramnum] = "fallback_application_name";
+ values[paramnum] = pset.progname;
+ keywords[++paramnum] = "client_encoding";
+ values[paramnum] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
+ keywords[++paramnum] = NULL;
+ values[paramnum] = NULL;
n_conn = PQconnectdbParams(keywords, values, true);
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 275bdcc..e036332 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1771,6 +1771,42 @@ session_username(void)
return PQuser(pset.db);
}
+/*
+ * Checks if connection string starts with either of the valid URI prefix
+ * designators.
+ *
+ * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+static int
+uri_prefix_length(const char *connstr)
+{
+ const char uri_designator[] = "postgresql://";
+ const char short_uri_designator[] = "postgres://";
+ if (strncmp(connstr, uri_designator,
+ sizeof(uri_designator) - 1) == 0)
+ return sizeof(uri_designator) - 1;
+
+ if (strncmp(connstr, short_uri_designator,
+ sizeof(short_uri_designator) - 1) == 0)
+ return sizeof(short_uri_designator) - 1;
+
+ return 0;
+}
+
+/*
+ * Recognized connection string either starts with a valid URI prefix or
+ * contains a "=" in it.
+ *
+ * XXX copied from libpq/fe-connect.c
+ */
+bool
+recognized_connection_string(const char *connstr)
+{
+ return uri_prefix_length(connstr) != 0 || strchr(connstr, '=') != NULL;
+}
+
/* expand_tilde
*
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index eb14d1c..079da43 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -49,4 +49,6 @@ extern const char *session_username(void);
extern void expand_tilde(char **filename);
+extern bool recognized_connection_string(const char *connstr);
+
#endif /* COMMON_H */
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index e39a07c..1c57924 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -69,6 +69,10 @@ extern char *filename_completion_function();
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
+/* XXX Until we can tab complete for URIs and services, each of which
+ * should populate their own lists */
+static const char *const empty_list[] = {NULL};
+
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
@@ -3706,10 +3710,22 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST_CS(my_list);
}
+
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ {
+ /* URI/service completion. Nothing for now */
+ if (recognized_connection_string(text))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_databases);
+ }
else if (strcmp(prev2_wd, "\\connect") == 0 || strcmp(prev2_wd, "\\c") == 0)
- COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ {
+ if (recognized_connection_string(prev_wd))
+ COMPLETE_WITH_LIST(empty_list);
+ else
+ COMPLETE_WITH_QUERY(Query_for_list_of_roles);
+ }
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
--
2.1.0
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-27 16:42 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-02-27 17:51 ` Alvaro Herrera <[email protected]>
2015-02-27 20:54 ` Re: POLA violation with \c service= David Fetter <[email protected]>
1 sibling, 1 reply; 992+ messages in thread
From: Alvaro Herrera @ 2015-02-27 17:51 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
I don't understand. Why don't these patches move anything to
src/common?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-27 16:42 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-27 17:51 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-02-27 20:54 ` David Fetter <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: David Fetter @ 2015-02-27 20:54 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Fri, Feb 27, 2015 at 02:51:18PM -0300, Alvaro Herrera wrote:
> I don't understand. Why don't these patches move anything to
> src/common?
Because I misunderstood the scope. Hope to get to those this evening.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-27 16:42 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-03-20 12:43 ` David Fetter <[email protected]>
1 sibling, 0 replies; 992+ messages in thread
From: David Fetter @ 2015-03-20 12:43 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Fri, Feb 27, 2015 at 08:42:29AM -0800, David Fetter wrote:
> On Mon, Feb 23, 2015 at 05:56:12PM -0300, Alvaro Herrera wrote:
> >
> > David Fetter wrote:
> >
> > > My thinking behind this was that the patch is a bug fix and intended
> > > to be back-patched, so I wanted to mess with as little infrastructure
> > > as possible. A new version of libpq seems like a very big ask for
> > > such a case. You'll recall that the original problem was that
> > >
> > > \c service=foo
> > >
> > > only worked accidentally for some pretty narrow use cases and broke
> > > without much of a clue for the rest. It turned out that the general
> > > problem was that options given to psql on the command line were not
> > > even remotely equivalent to \c, even though they were documented to
> > > be.
> >
> > So, in view of these arguments and those put forward by Pavel
> > downthread, I think the attached is an acceptable patch for the master
> > branch. It doesn't apply to back branches though; 9.4 and 9.3 have a
> > conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
> > and 9.1 and 9.0 are problematic all over because they don't have
> > src/common. Could you please submit patches adapted for each group of
> > branches?
>
> Please find patches attached for each live branch.
Is this getting into the upcoming bug fix releases? Does it need
rework to do so?
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-03-02 21:52 ` Robert Haas <[email protected]>
2015-03-02 22:05 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2 siblings, 1 reply; 992+ messages in thread
From: Robert Haas @ 2015-03-02 21:52 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: David Fetter <[email protected]>; Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Mon, Feb 23, 2015 at 3:56 PM, Alvaro Herrera
<[email protected]> wrote:
> David Fetter wrote:
>
>> My thinking behind this was that the patch is a bug fix and intended
>> to be back-patched, so I wanted to mess with as little infrastructure
>> as possible. A new version of libpq seems like a very big ask for
>> such a case. You'll recall that the original problem was that
>>
>> \c service=foo
>>
>> only worked accidentally for some pretty narrow use cases and broke
>> without much of a clue for the rest. It turned out that the general
>> problem was that options given to psql on the command line were not
>> even remotely equivalent to \c, even though they were documented to
>> be.
>
> So, in view of these arguments and those put forward by Pavel
> downthread, I think the attached is an acceptable patch for the master
> branch. It doesn't apply to back branches though; 9.4 and 9.3 have a
> conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
> and 9.1 and 9.0 are problematic all over because they don't have
> src/common. Could you please submit patches adapted for each group of
> branches?
I'm fine with this change in master, but I vote against back-patching
it. This is not such an important problem that we need to take the
risk of destabilizing existing installations.
(Also, src/common is only 2 years old, so how would we back-patch
anything touching that past 9.3 anyway?)
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-02 21:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
@ 2015-03-02 22:05 ` David Fetter <[email protected]>
2015-03-02 22:28 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-04 02:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
0 siblings, 2 replies; 992+ messages in thread
From: David Fetter @ 2015-03-02 22:05 UTC (permalink / raw)
To: Robert Haas <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Mon, Mar 02, 2015 at 04:52:37PM -0500, Robert Haas wrote:
> On Mon, Feb 23, 2015 at 3:56 PM, Alvaro Herrera
> <[email protected]> wrote:
> > David Fetter wrote:
> >
> >> My thinking behind this was that the patch is a bug fix and intended
> >> to be back-patched, so I wanted to mess with as little infrastructure
> >> as possible. A new version of libpq seems like a very big ask for
> >> such a case. You'll recall that the original problem was that
> >>
> >> \c service=foo
> >>
> >> only worked accidentally for some pretty narrow use cases and broke
> >> without much of a clue for the rest. It turned out that the general
> >> problem was that options given to psql on the command line were not
> >> even remotely equivalent to \c, even though they were documented to
> >> be.
> >
> > So, in view of these arguments and those put forward by Pavel
> > downthread, I think the attached is an acceptable patch for the master
> > branch. It doesn't apply to back branches though; 9.4 and 9.3 have a
> > conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
> > and 9.1 and 9.0 are problematic all over because they don't have
> > src/common. Could you please submit patches adapted for each group of
> > branches?
>
> I'm fine with this change in master, but I vote against back-patching
> it. This is not such an important problem that we need to take the
> risk of destabilizing existing installations.
So just to clarify, are you against back-patching the behavior change,
or the addition to src/common?
> (Also, src/common is only 2 years old, so how would we back-patch
> anything touching that past 9.3 anyway?)
I was hacking something together to add it. Should I stop?
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-02 21:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
2015-03-02 22:05 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-03-02 22:28 ` Alvaro Herrera <[email protected]>
1 sibling, 0 replies; 992+ messages in thread
From: Alvaro Herrera @ 2015-03-02 22:28 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Robert Haas <[email protected]>; Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
David Fetter wrote:
> On Mon, Mar 02, 2015 at 04:52:37PM -0500, Robert Haas wrote:
> > On Mon, Feb 23, 2015 at 3:56 PM, Alvaro Herrera
> > <[email protected]> wrote:
> > > David Fetter wrote:
> > >
> > >> My thinking behind this was that the patch is a bug fix and intended
> > >> to be back-patched, so I wanted to mess with as little infrastructure
> > >> as possible. A new version of libpq seems like a very big ask for
> > >> such a case. You'll recall that the original problem was that
> > >>
> > >> \c service=foo
> > >>
> > >> only worked accidentally for some pretty narrow use cases and broke
> > >> without much of a clue for the rest. It turned out that the general
> > >> problem was that options given to psql on the command line were not
> > >> even remotely equivalent to \c, even though they were documented to
> > >> be.
> > >
> > > So, in view of these arguments and those put forward by Pavel
> > > downthread, I think the attached is an acceptable patch for the master
> > > branch. It doesn't apply to back branches though; 9.4 and 9.3 have a
> > > conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
> > > and 9.1 and 9.0 are problematic all over because they don't have
> > > src/common. Could you please submit patches adapted for each group of
> > > branches?
> >
> > I'm fine with this change in master, but I vote against back-patching
> > it. This is not such an important problem that we need to take the
> > risk of destabilizing existing installations.
>
> So just to clarify, are you against back-patching the behavior change,
> or the addition to src/common?
Not sure I agree with that. Currently \c is pretty useless with
services and URIs.
(The recently introduced behavior that it "forgets" the old connection
info when the connection is lost, for example the server crashes, is
pretty unhelpful too.)
> > (Also, src/common is only 2 years old, so how would we back-patch
> > anything touching that past 9.3 anyway?)
>
> I was hacking something together to add it. Should I stop?
I think I wasn't very clear. What I was trying to say was that for all
branches that have src/common we should put the duplicated functions
there, and for older branches we'd just accept the duplication.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-02 21:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
2015-03-02 22:05 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-03-04 02:52 ` Robert Haas <[email protected]>
2015-03-04 13:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
1 sibling, 1 reply; 992+ messages in thread
From: Robert Haas @ 2015-03-04 02:52 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Mon, Mar 2, 2015 at 5:05 PM, David Fetter <[email protected]> wrote:
> So just to clarify, are you against back-patching the behavior change,
> or the addition to src/common?
Mostly the latter.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-02 21:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
2015-03-02 22:05 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-03-04 02:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
@ 2015-03-04 13:33 ` David Fetter <[email protected]>
2015-03-04 14:01 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
0 siblings, 1 reply; 992+ messages in thread
From: David Fetter @ 2015-03-04 13:33 UTC (permalink / raw)
To: Robert Haas <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Tue, Mar 03, 2015 at 09:52:55PM -0500, Robert Haas wrote:
> On Mon, Mar 2, 2015 at 5:05 PM, David Fetter <[email protected]> wrote:
> > So just to clarify, are you against back-patching the behavior
> > change, or the addition to src/common?
>
> Mostly the latter.
So you're saying the former isn't a problem? To recap, the behavior I
dug up was that sending a conninfo string or a URI to \c resulted in
\c's silently mangling same in a way that could only work accidentally.
Anyhow, patches have been posted for both approaches to all relevant
branches.
Cheers,
David.
--
David Fetter <[email protected]> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: [email protected]
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-23 20:56 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-03-02 21:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
2015-03-02 22:05 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-03-04 02:52 ` Re: POLA violation with \c service= Robert Haas <[email protected]>
2015-03-04 13:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
@ 2015-03-04 14:01 ` Robert Haas <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Robert Haas @ 2015-03-04 14:01 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Pavel Stehule <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
On Wed, Mar 4, 2015 at 8:33 AM, David Fetter <[email protected]> wrote:
> On Tue, Mar 03, 2015 at 09:52:55PM -0500, Robert Haas wrote:
>> On Mon, Mar 2, 2015 at 5:05 PM, David Fetter <[email protected]> wrote:
>> > So just to clarify, are you against back-patching the behavior
>> > change, or the addition to src/common?
>>
>> Mostly the latter.
>
> So you're saying the former isn't a problem? To recap, the behavior I
> dug up was that sending a conninfo string or a URI to \c resulted in
> \c's silently mangling same in a way that could only work accidentally.
Well, the thing is, I'm not sure that's actually documented to work
anywhere. psql says this:
\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]
The psql documentation looks like this:
\c or \connect [ dbname [ username ] [ host ] [ port ] ]
Neither says anything about being able to use a conninfo string or a
URI. So I am not sure why we shouldn't regard this as a new feature
--- which, by the way, should be documented. Arguably the right thing
to do is back-patch a change that prevents the dbname from being
interpreted as anything other than a literal database name, and then
in master make it work as you suggest. Now, if those two patches are
substantially equal in size and risk, then you could argue that's just
silly, and that we should just make this work all the way back. I'm
willing to accept that argument if it is in fact true. But I'm not
very excited about doing what amounts to a refactoring exercise in the
back-branches. Shuffling code around from one file to another seems
like something that we really ought to only be doing in master unless
there's a really compelling reason to do otherwise, and making
something work that is not documented to work does not compel me.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
@ 2015-02-21 06:04 ` Pavel Stehule <[email protected]>
2015-02-21 06:19 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
1 sibling, 1 reply; 992+ messages in thread
From: Pavel Stehule @ 2015-02-21 06:04 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: David Fetter <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
Hi
2015-02-20 21:55 GMT+01:00 Alvaro Herrera <[email protected]>:
> Pavel Stehule wrote:
> > 2015-02-20 8:22 GMT+01:00 David Fetter <[email protected]>:
> >
> > > On Fri, Feb 20, 2015 at 07:10:29AM +0100, Pavel Stehule wrote:
> > > > Hi
> > > >
> > > > I am happy with doc changes now.
> > > >
> > > > When I test last patch, I found sigfault bug, because host =
> > > > PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
> > > >
> > > > If you are agree with fix, I'll mark this patch as ready for commit.
> > >
> > > Thanks for fixing the bug. Let's go with this.
> > >
> >
> > marked as "ready for commit"
>
> Gave this patch a look. In general it looks pretty good, but there is
> one troublesome point: it duplicates two functions from libpq into psql,
> including the URI designators. This doesn't look very nice. I thought
> about just creating a new src/common (say connstring.c) to host those
> two functions and the URI designators, but then on closer look I noticed
> that libpq's facilities for URI parsing become severed: two very small
> functions become part of libpgcommon, while the more complex parts
> remain in libpq.
>
> On the other hand, if we see that psql needs this functionality, isn't
> this a clue that other client programs might find it useful too?
> (Honestly I'm not completely sure about this point -- other opinions?)
>
> I see three[four] ways forward from here:
>
> 1. export this functionality in libpq as one or two new functions. This
> would need proper docs, exports.txt, etc.
>
I don't think so it is preferable way - me (as developer) doesn't interest
a format of connection string - and if somebody would to check the format,
then he use a simply regexp. It is task for libpq to check and detect used
format correctly. "psql" works on very low level and needs these
functionality almost all for autocomplete - and it is not usual task for
database based applications.
>
> 2. export it in libpgcommon. If we choose this option we should
> probably rename those functions, as in the attached patch.
>
+1
>
> 3. accept the patch as is, i.e. duplicate the libq-internal functions in
> psql.
>
> [4. reject the whole thing]
>
> I lean towards (2) myself, but what do others think?
>
aggree with you
Regards
Pavel
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
^ permalink raw reply [nested|flat] 992+ messages in thread
* Re: POLA violation with \c service=
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-19 20:32 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 22:33 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 06:10 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 07:22 ` Re: POLA violation with \c service= David Fetter <[email protected]>
2015-02-20 07:28 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Re: POLA violation with \c service= Alvaro Herrera <[email protected]>
2015-02-21 06:04 ` Re: POLA violation with \c service= Pavel Stehule <[email protected]>
@ 2015-02-21 06:19 ` Pavel Stehule <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Pavel Stehule @ 2015-02-21 06:19 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: David Fetter <[email protected]>; Erik Rijkers <[email protected]>; Andrew Dunstan <[email protected]>; Heikki Linnakangas <[email protected]>; Albe Laurenz <[email protected]>; pgsql-hackers
2015-02-21 7:04 GMT+01:00 Pavel Stehule <[email protected]>:
> Hi
>
> 2015-02-20 21:55 GMT+01:00 Alvaro Herrera <[email protected]>:
>
>> Pavel Stehule wrote:
>> > 2015-02-20 8:22 GMT+01:00 David Fetter <[email protected]>:
>> >
>> > > On Fri, Feb 20, 2015 at 07:10:29AM +0100, Pavel Stehule wrote:
>> > > > Hi
>> > > >
>> > > > I am happy with doc changes now.
>> > > >
>> > > > When I test last patch, I found sigfault bug, because host =
>> > > > PQhost(o_conn); returns NULL. I fexed it - please, see patch 007
>> > > >
>> > > > If you are agree with fix, I'll mark this patch as ready for commit.
>> > >
>> > > Thanks for fixing the bug. Let's go with this.
>> > >
>> >
>> > marked as "ready for commit"
>>
>> Gave this patch a look. In general it looks pretty good, but there is
>> one troublesome point: it duplicates two functions from libpq into psql,
>> including the URI designators. This doesn't look very nice. I thought
>> about just creating a new src/common (say connstring.c) to host those
>> two functions and the URI designators, but then on closer look I noticed
>> that libpq's facilities for URI parsing become severed: two very small
>> functions become part of libpgcommon, while the more complex parts
>> remain in libpq.
>>
>> On the other hand, if we see that psql needs this functionality, isn't
>> this a clue that other client programs might find it useful too?
>> (Honestly I'm not completely sure about this point -- other opinions?)
>>
>> I see three[four] ways forward from here:
>>
>> 1. export this functionality in libpq as one or two new functions. This
>> would need proper docs, exports.txt, etc.
>>
>
> I don't think so it is preferable way - me (as developer) doesn't interest
> a format of connection string - and if somebody would to check the format,
> then he use a simply regexp. It is task for libpq to check and detect used
> format correctly. "psql" works on very low level and needs these
> functionality almost all for autocomplete - and it is not usual task for
> database based applications.
>
and libpq should not bloat too much
>
>
>>
>> 2. export it in libpgcommon. If we choose this option we should
>> probably rename those functions, as in the attached patch.
>>
>
> +1
>
>
>>
>> 3. accept the patch as is, i.e. duplicate the libq-internal functions in
>> psql.
>>
>> [4. reject the whole thing]
>>
>> I lean towards (2) myself, but what do others think?
>>
>
> aggree with you
>
> Regards
>
> Pavel
>
>
>>
>> --
>> Álvaro Herrera http://www.2ndQuadrant.com/
>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>>
>
>
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
* [PATCH] Do not push the active snapshot for copy_table_data before it's needed.
@ 2026-04-10 10:17 Antonin Houska <[email protected]>
0 siblings, 0 replies; 992+ messages in thread
From: Antonin Houska @ 2026-04-10 10:17 UTC (permalink / raw)
make_new_heap() can launch parallel workers when building index on TOAST
relation. If the snapshot for copy_table_data() is already the active
snapshot, the workers can incorrectly consider it their transaction snapshot.
---
src/backend/commands/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867246f..08fd132a4e3 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -1013,8 +1013,6 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
* Wait until the worker has the initial snapshot and retrieve it.
*/
snapshot = get_initial_snapshot(decoding_worker);
-
- PushActiveSnapshot(snapshot);
}
/* for CLUSTER or REPACK USING INDEX, mark the index as the one to use */
@@ -1038,6 +1036,8 @@ rebuild_relation(Relation OldHeap, Relation index, bool verbose,
NewHeap = table_open(OIDNewHeap, NoLock);
/* Copy the heap data into the new table in the desired order */
+ if (snapshot)
+ PushActiveSnapshot(snapshot);
copy_table_data(NewHeap, OldHeap, index, snapshot, verbose,
&swap_toast_by_content, &frozenXid, &cutoffMulti);
--
2.47.3
--=-=-=--
^ permalink raw reply [nested|flat] 992+ messages in thread
end of thread, other threads:[~2026-04-10 10:17 UTC | newest]
Thread overview: 992+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-01 07:38 Re: POLA violation with \c service= Pavel Stehule <[email protected]>
2015-02-19 18:51 ` David Fetter <[email protected]>
2015-02-19 20:32 ` Pavel Stehule <[email protected]>
2015-02-19 22:33 ` David Fetter <[email protected]>
2015-02-20 06:10 ` Pavel Stehule <[email protected]>
2015-02-20 07:22 ` David Fetter <[email protected]>
2015-02-20 07:27 ` Pavel Stehule <[email protected]>
2015-02-20 07:28 ` Pavel Stehule <[email protected]>
2015-02-20 20:55 ` Alvaro Herrera <[email protected]>
2015-02-20 21:08 ` David Fetter <[email protected]>
2015-02-20 21:25 ` Alvaro Herrera <[email protected]>
2015-02-21 06:17 ` Pavel Stehule <[email protected]>
2015-02-23 20:56 ` Alvaro Herrera <[email protected]>
2015-02-23 21:02 ` Alvaro Herrera <[email protected]>
2015-02-27 16:42 ` David Fetter <[email protected]>
2015-02-27 17:51 ` Alvaro Herrera <[email protected]>
2015-02-27 20:54 ` David Fetter <[email protected]>
2015-03-20 12:43 ` David Fetter <[email protected]>
2015-03-02 21:52 ` Robert Haas <[email protected]>
2015-03-02 22:05 ` David Fetter <[email protected]>
2015-03-02 22:28 ` Alvaro Herrera <[email protected]>
2015-03-04 02:52 ` Robert Haas <[email protected]>
2015-03-04 13:33 ` David Fetter <[email protected]>
2015-03-04 14:01 ` Robert Haas <[email protected]>
2015-02-21 06:04 ` Pavel Stehule <[email protected]>
2015-02-21 06:19 ` Pavel Stehule <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
2026-04-10 10:17 [PATCH] Do not push the active snapshot for copy_table_data before it's needed. Antonin Houska <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox