Re: Table's REPLICATE IDENTITY : where is it kept? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Table's REPLICATE IDENTITY : where is it kept?
Date
Msg-id 24602.1532957847@sss.pgh.pa.us
Whole thread Raw
In response to Table's REPLICATE IDENTITY : where is it kept?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Responses Re: Table's REPLICATE IDENTITY : where is it kept?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Table's REPLICATE IDENTITY : where is it kept?
Next
From: Achilleas Mantzios
Date:
Subject: Re: Table's REPLICATE IDENTITY : where is it kept?