Skip to content

Commit 75eb976

Browse files
author
Amit Kapila
committed
Rename pubgencols_type to pubgencols in pg_publication.
The column added in commit e65dbc9, 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
1 parent 30a6ed0 commit 75eb976

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6407,7 +6407,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
64076407

64086408
<row>
64096409
<entry role="catalog_table_entry"><para role="column_definition">
6410-
<structfield>pubgencols_type</structfield> <type>char</type>
6410+
<structfield>pubgencols</structfield> <type>char</type>
64116411
</para>
64126412
<para>
64136413
Controls how to handle generated column replication when there is no

src/backend/catalog/pg_publication.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ GetPublication(Oid pubid)
10801080
pub->pubactions.pubdelete = pubform->pubdelete;
10811081
pub->pubactions.pubtruncate = pubform->pubtruncate;
10821082
pub->pubviaroot = pubform->pubviaroot;
1083-
pub->pubgencols_type = pubform->pubgencols_type;
1083+
pub->pubgencols_type = pubform->pubgencols;
10841084

10851085
ReleaseSysCache(tup);
10861086

src/backend/commands/publicationcmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ CreatePublication(ParseState *pstate, CreatePublicationStmt *stmt)
836836
BoolGetDatum(pubactions.pubtruncate);
837837
values[Anum_pg_publication_pubviaroot - 1] =
838838
BoolGetDatum(publish_via_partition_root);
839-
values[Anum_pg_publication_pubgencols_type - 1] =
839+
values[Anum_pg_publication_pubgencols - 1] =
840840
CharGetDatum(publish_generated_columns);
841841

842842
tup = heap_form_tuple(RelationGetDescr(rel), values, nulls);
@@ -1048,8 +1048,8 @@ AlterPublicationOptions(ParseState *pstate, AlterPublicationStmt *stmt,
10481048

10491049
if (publish_generated_columns_given)
10501050
{
1051-
values[Anum_pg_publication_pubgencols_type - 1] = CharGetDatum(publish_generated_columns);
1052-
replaces[Anum_pg_publication_pubgencols_type - 1] = true;
1051+
values[Anum_pg_publication_pubgencols - 1] = CharGetDatum(publish_generated_columns);
1052+
replaces[Anum_pg_publication_pubgencols - 1] = true;
10531053
}
10541054

10551055
tup = heap_modify_tuple(tup, RelationGetDescr(rel), values, nulls,

src/backend/utils/cache/relcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5820,7 +5820,7 @@ RelationBuildPublicationDesc(Relation relation, PublicationDesc *pubdesc)
58205820
if ((pubform->pubupdate || pubform->pubdelete) &&
58215821
pub_contains_invalid_column(pubid, relation, ancestors,
58225822
pubform->pubviaroot,
5823-
pubform->pubgencols_type,
5823+
pubform->pubgencols,
58245824
&invalid_column_list,
58255825
&invalid_gen_col))
58265826
{

src/bin/pg_dump/pg_dump.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4291,7 +4291,7 @@ getPublications(Archive *fout)
42914291
int i_pubdelete;
42924292
int i_pubtruncate;
42934293
int i_pubviaroot;
4294-
int i_pubgencols_type;
4294+
int i_pubgencols;
42954295
int i,
42964296
ntups;
42974297

@@ -4316,9 +4316,9 @@ getPublications(Archive *fout)
43164316
appendPQExpBufferStr(query, "false AS pubviaroot, ");
43174317

43184318
if (fout->remoteVersion >= 180000)
4319-
appendPQExpBufferStr(query, "p.pubgencols_type ");
4319+
appendPQExpBufferStr(query, "p.pubgencols ");
43204320
else
4321-
appendPQExpBuffer(query, "'%c' AS pubgencols_type ", PUBLISH_GENCOLS_NONE);
4321+
appendPQExpBuffer(query, "'%c' AS pubgencols ", PUBLISH_GENCOLS_NONE);
43224322

43234323
appendPQExpBufferStr(query, "FROM pg_publication p");
43244324

@@ -4339,7 +4339,7 @@ getPublications(Archive *fout)
43394339
i_pubdelete = PQfnumber(res, "pubdelete");
43404340
i_pubtruncate = PQfnumber(res, "pubtruncate");
43414341
i_pubviaroot = PQfnumber(res, "pubviaroot");
4342-
i_pubgencols_type = PQfnumber(res, "pubgencols_type");
4342+
i_pubgencols = PQfnumber(res, "pubgencols");
43434343

43444344
pubinfo = pg_malloc(ntups * sizeof(PublicationInfo));
43454345

@@ -4365,7 +4365,7 @@ getPublications(Archive *fout)
43654365
pubinfo[i].pubviaroot =
43664366
(strcmp(PQgetvalue(res, i, i_pubviaroot), "t") == 0);
43674367
pubinfo[i].pubgencols_type =
4368-
*(PQgetvalue(res, i, i_pubgencols_type));
4368+
*(PQgetvalue(res, i, i_pubgencols));
43694369

43704370
/* Decide whether we want to dump it */
43714371
selectDumpableObject(&(pubinfo[i].dobj), fout);

src/bin/psql/describe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6373,7 +6373,7 @@ listPublications(const char *pattern)
63736373
gettext_noop("Truncates"));
63746374
if (pset.sversion >= 180000)
63756375
appendPQExpBuffer(&buf,
6376-
",\n (CASE pubgencols_type\n"
6376+
",\n (CASE pubgencols\n"
63776377
" WHEN '%c' THEN 'none'\n"
63786378
" WHEN '%c' THEN 'stored'\n"
63796379
" END) AS \"%s\"",
@@ -6507,7 +6507,7 @@ describePublications(const char *pattern)
65076507

65086508
if (has_pubgencols)
65096509
appendPQExpBuffer(&buf,
6510-
", (CASE pubgencols_type\n"
6510+
", (CASE pubgencols\n"
65116511
" WHEN '%c' THEN 'none'\n"
65126512
" WHEN '%c' THEN 'stored'\n"
65136513
" END) AS \"%s\"\n",

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/* yyyymmddN */
60-
#define CATALOG_VERSION_NO 202501281
60+
#define CATALOG_VERSION_NO 202501282
6161

6262
#endif

src/include/catalog/pg_publication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ CATALOG(pg_publication,6104,PublicationRelationId)
5959
* 'n'(none) if generated column data should not be published. 's'(stored)
6060
* if stored generated column data should be published.
6161
*/
62-
char pubgencols_type;
62+
char pubgencols;
6363
} FormData_pg_publication;
6464

6565
/* ----------------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy