From: Tom Lane <tgl@sss.pgh.pa.us>
To: Achilleas Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Table's REPLICATE IDENTITY : where is it kept?
Date: Mon, 30 Jul 2018 09:37:27 -0400
Message-ID: <24602.1532957847@sss.pgh.pa.us> (raw)
In-Reply-To: <1e6cc5ad-b84a-7c07-8c08-a4d0c3cdc938@matrix.gatewaynet.com>
References: <1e6cc5ad-b84a-7c07-8c08-a4d0c3cdc938@matrix.gatewaynet.com>
Achilleas Mantzios <achill@matrix.gatewaynet.com> writes:
> I noticed that after changing a table's REPLICA IDENTITY via the ALTER TABLE command, this is not reflected in pg_dump.
Really? There's certainly code in there that purports to do it:
/*
* dump properties we only have ALTER TABLE syntax for
*/
if ((tbinfo->relkind == RELKIND_RELATION ||
tbinfo->relkind == RELKIND_PARTITIONED_TABLE ||
tbinfo->relkind == RELKIND_MATVIEW) &&
tbinfo->relreplident != REPLICA_IDENTITY_DEFAULT)
{
if (tbinfo->relreplident == REPLICA_IDENTITY_INDEX)
{
/* nothing to do, will be set when the index is dumped */
}
else if (tbinfo->relreplident == REPLICA_IDENTITY_NOTHING)
{
appendPQExpBuffer(q, "\nALTER TABLE ONLY %s REPLICA IDENTITY NOTHING;\n",
qualrelname);
}
else if (tbinfo->relreplident == REPLICA_IDENTITY_FULL)
{
appendPQExpBuffer(q, "\nALTER TABLE ONLY %s REPLICA IDENTITY FULL;\n",
qualrelname);
}
}
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, achill@matrix.gatewaynet.com, pgsql-admin@lists.postgresql.org
Subject: Re: Table's REPLICATE IDENTITY : where is it kept?
In-Reply-To: <24602.1532957847@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox