mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Rename pubgencols_type to pubgencols in pg_publication.
The column added in commit e65dbc9927
, pubgencols_type, was inconsistent
with the naming conventions of other columns in the pg_publication
catalog.
Author: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Peter Smith <smithpb2250@gmail.com>
Discussion: https://postgr.es/m/CALDaNm1u-ufVOW-RUsXSooqzkpohxfZYy=z78fbcr_9Pq5hbCg@mail.gmail.com
This commit is contained in:
@ -6407,7 +6407,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry role="catalog_table_entry"><para role="column_definition">
|
<entry role="catalog_table_entry"><para role="column_definition">
|
||||||
<structfield>pubgencols_type</structfield> <type>char</type>
|
<structfield>pubgencols</structfield> <type>char</type>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Controls how to handle generated column replication when there is no
|
Controls how to handle generated column replication when there is no
|
||||||
|
@ -1080,7 +1080,7 @@ GetPublication(Oid pubid)
|
|||||||
pub->pubactions.pubdelete = pubform->pubdelete;
|
pub->pubactions.pubdelete = pubform->pubdelete;
|
||||||
pub->pubactions.pubtruncate = pubform->pubtruncate;
|
pub->pubactions.pubtruncate = pubform->pubtruncate;
|
||||||
pub->pubviaroot = pubform->pubviaroot;
|
pub->pubviaroot = pubform->pubviaroot;
|
||||||
pub->pubgencols_type = pubform->pubgencols_type;
|
pub->pubgencols_type = pubform->pubgencols;
|
||||||
|
|
||||||
ReleaseSysCache(tup);
|
ReleaseSysCache(tup);
|
||||||
|
|
||||||
|
@ -836,7 +836,7 @@ CreatePublication(ParseState *pstate, CreatePublicationStmt *stmt)
|
|||||||
BoolGetDatum(pubactions.pubtruncate);
|
BoolGetDatum(pubactions.pubtruncate);
|
||||||
values[Anum_pg_publication_pubviaroot - 1] =
|
values[Anum_pg_publication_pubviaroot - 1] =
|
||||||
BoolGetDatum(publish_via_partition_root);
|
BoolGetDatum(publish_via_partition_root);
|
||||||
values[Anum_pg_publication_pubgencols_type - 1] =
|
values[Anum_pg_publication_pubgencols - 1] =
|
||||||
CharGetDatum(publish_generated_columns);
|
CharGetDatum(publish_generated_columns);
|
||||||
|
|
||||||
tup = heap_form_tuple(RelationGetDescr(rel), values, nulls);
|
tup = heap_form_tuple(RelationGetDescr(rel), values, nulls);
|
||||||
@ -1048,8 +1048,8 @@ AlterPublicationOptions(ParseState *pstate, AlterPublicationStmt *stmt,
|
|||||||
|
|
||||||
if (publish_generated_columns_given)
|
if (publish_generated_columns_given)
|
||||||
{
|
{
|
||||||
values[Anum_pg_publication_pubgencols_type - 1] = CharGetDatum(publish_generated_columns);
|
values[Anum_pg_publication_pubgencols - 1] = CharGetDatum(publish_generated_columns);
|
||||||
replaces[Anum_pg_publication_pubgencols_type - 1] = true;
|
replaces[Anum_pg_publication_pubgencols - 1] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
tup = heap_modify_tuple(tup, RelationGetDescr(rel), values, nulls,
|
tup = heap_modify_tuple(tup, RelationGetDescr(rel), values, nulls,
|
||||||
|
2
src/backend/utils/cache/relcache.c
vendored
2
src/backend/utils/cache/relcache.c
vendored
@ -5820,7 +5820,7 @@ RelationBuildPublicationDesc(Relation relation, PublicationDesc *pubdesc)
|
|||||||
if ((pubform->pubupdate || pubform->pubdelete) &&
|
if ((pubform->pubupdate || pubform->pubdelete) &&
|
||||||
pub_contains_invalid_column(pubid, relation, ancestors,
|
pub_contains_invalid_column(pubid, relation, ancestors,
|
||||||
pubform->pubviaroot,
|
pubform->pubviaroot,
|
||||||
pubform->pubgencols_type,
|
pubform->pubgencols,
|
||||||
&invalid_column_list,
|
&invalid_column_list,
|
||||||
&invalid_gen_col))
|
&invalid_gen_col))
|
||||||
{
|
{
|
||||||
|
@ -4291,7 +4291,7 @@ getPublications(Archive *fout)
|
|||||||
int i_pubdelete;
|
int i_pubdelete;
|
||||||
int i_pubtruncate;
|
int i_pubtruncate;
|
||||||
int i_pubviaroot;
|
int i_pubviaroot;
|
||||||
int i_pubgencols_type;
|
int i_pubgencols;
|
||||||
int i,
|
int i,
|
||||||
ntups;
|
ntups;
|
||||||
|
|
||||||
@ -4316,9 +4316,9 @@ getPublications(Archive *fout)
|
|||||||
appendPQExpBufferStr(query, "false AS pubviaroot, ");
|
appendPQExpBufferStr(query, "false AS pubviaroot, ");
|
||||||
|
|
||||||
if (fout->remoteVersion >= 180000)
|
if (fout->remoteVersion >= 180000)
|
||||||
appendPQExpBufferStr(query, "p.pubgencols_type ");
|
appendPQExpBufferStr(query, "p.pubgencols ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query, "'%c' AS pubgencols_type ", PUBLISH_GENCOLS_NONE);
|
appendPQExpBuffer(query, "'%c' AS pubgencols ", PUBLISH_GENCOLS_NONE);
|
||||||
|
|
||||||
appendPQExpBufferStr(query, "FROM pg_publication p");
|
appendPQExpBufferStr(query, "FROM pg_publication p");
|
||||||
|
|
||||||
@ -4339,7 +4339,7 @@ getPublications(Archive *fout)
|
|||||||
i_pubdelete = PQfnumber(res, "pubdelete");
|
i_pubdelete = PQfnumber(res, "pubdelete");
|
||||||
i_pubtruncate = PQfnumber(res, "pubtruncate");
|
i_pubtruncate = PQfnumber(res, "pubtruncate");
|
||||||
i_pubviaroot = PQfnumber(res, "pubviaroot");
|
i_pubviaroot = PQfnumber(res, "pubviaroot");
|
||||||
i_pubgencols_type = PQfnumber(res, "pubgencols_type");
|
i_pubgencols = PQfnumber(res, "pubgencols");
|
||||||
|
|
||||||
pubinfo = pg_malloc(ntups * sizeof(PublicationInfo));
|
pubinfo = pg_malloc(ntups * sizeof(PublicationInfo));
|
||||||
|
|
||||||
@ -4365,7 +4365,7 @@ getPublications(Archive *fout)
|
|||||||
pubinfo[i].pubviaroot =
|
pubinfo[i].pubviaroot =
|
||||||
(strcmp(PQgetvalue(res, i, i_pubviaroot), "t") == 0);
|
(strcmp(PQgetvalue(res, i, i_pubviaroot), "t") == 0);
|
||||||
pubinfo[i].pubgencols_type =
|
pubinfo[i].pubgencols_type =
|
||||||
*(PQgetvalue(res, i, i_pubgencols_type));
|
*(PQgetvalue(res, i, i_pubgencols));
|
||||||
|
|
||||||
/* Decide whether we want to dump it */
|
/* Decide whether we want to dump it */
|
||||||
selectDumpableObject(&(pubinfo[i].dobj), fout);
|
selectDumpableObject(&(pubinfo[i].dobj), fout);
|
||||||
|
@ -6373,7 +6373,7 @@ listPublications(const char *pattern)
|
|||||||
gettext_noop("Truncates"));
|
gettext_noop("Truncates"));
|
||||||
if (pset.sversion >= 180000)
|
if (pset.sversion >= 180000)
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
",\n (CASE pubgencols_type\n"
|
",\n (CASE pubgencols\n"
|
||||||
" WHEN '%c' THEN 'none'\n"
|
" WHEN '%c' THEN 'none'\n"
|
||||||
" WHEN '%c' THEN 'stored'\n"
|
" WHEN '%c' THEN 'stored'\n"
|
||||||
" END) AS \"%s\"",
|
" END) AS \"%s\"",
|
||||||
@ -6507,7 +6507,7 @@ describePublications(const char *pattern)
|
|||||||
|
|
||||||
if (has_pubgencols)
|
if (has_pubgencols)
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
", (CASE pubgencols_type\n"
|
", (CASE pubgencols\n"
|
||||||
" WHEN '%c' THEN 'none'\n"
|
" WHEN '%c' THEN 'none'\n"
|
||||||
" WHEN '%c' THEN 'stored'\n"
|
" WHEN '%c' THEN 'stored'\n"
|
||||||
" END) AS \"%s\"\n",
|
" END) AS \"%s\"\n",
|
||||||
|
@ -57,6 +57,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 202501281
|
#define CATALOG_VERSION_NO 202501282
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,7 +59,7 @@ CATALOG(pg_publication,6104,PublicationRelationId)
|
|||||||
* 'n'(none) if generated column data should not be published. 's'(stored)
|
* 'n'(none) if generated column data should not be published. 's'(stored)
|
||||||
* if stored generated column data should be published.
|
* if stored generated column data should be published.
|
||||||
*/
|
*/
|
||||||
char pubgencols_type;
|
char pubgencols;
|
||||||
} FormData_pg_publication;
|
} FormData_pg_publication;
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
|
Reference in New Issue
Block a user