I have a small fixup patch for your 20260102 patches, attached.
- needs additional #include because of recent changes elsewhere - copyright year updates - various typos - some style changes related to palloc APIs
From fe4cfd6a386f67a03a2382733690471cc108ae88 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <[email protected]> Date: Tue, 13 Jan 2026 11:20:30 +0100 Subject: [PATCH] Various small updates --- doc/src/sgml/ddl.sgml | 5 +++-- src/backend/commands/propgraphcmds.c | 13 ++++++------- src/backend/parser/gram.y | 2 +- src/backend/parser/parse_graphtable.c | 2 +- src/backend/rewrite/rewriteGraphTable.c | 3 ++- src/include/catalog/pg_propgraph_element.h | 2 +- src/include/catalog/pg_propgraph_element_label.h | 2 +- src/include/catalog/pg_propgraph_label.h | 2 +- src/include/catalog/pg_propgraph_label_property.h | 2 +- src/include/catalog/pg_propgraph_property.h | 2 +- src/include/commands/propgraphcmds.h | 2 +- src/include/parser/parse_graphtable.h | 2 +- src/include/rewrite/rewriteGraphTable.h | 2 +- src/test/regress/expected/create_property_graph.out | 2 +- src/test/regress/sql/create_property_graph.sql | 2 +- 15 files changed, 23 insertions(+), 22 deletions(-) diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 38101d9b8b3..7f8fd300a50 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -5859,12 +5859,13 @@ <title>Property Graphs</title> <para> With this definition, we can write a query like this: <programlisting> -SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customer)-[ IS has_placed]->(o IS "order" WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name)); +SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customer)-[IS has_placed]->(o IS "order" WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name)); </programlisting> With the new labels the <literal>MATCH</literal> clause is now more intuitive. </para> + <para> - Please notice that label <literal>order</literal> is quoted. If we run above + Notice that the label <literal>order</literal> is quoted. If we run above statements without adding quotes around <literal>order</literal>, we will get a syntax error since <literal>order</literal> is a keyword. </para> diff --git a/src/backend/commands/propgraphcmds.c b/src/backend/commands/propgraphcmds.c index 9d8291e1b4e..927938e2181 100644 --- a/src/backend/commands/propgraphcmds.c +++ b/src/backend/commands/propgraphcmds.c @@ -3,7 +3,7 @@ * propgraphcmds.c * property graph manipulation * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/backend/commands/propgraphcmds.c @@ -378,7 +378,6 @@ propgraph_edge_get_ref_keys(ParseState *pstate, const List *keycols, const List AttrNumber *refattnums; Oid *keyeqops; Datum *datums; - int i; Assert((keycols && refcols) || (!keycols && !refcols)); @@ -395,7 +394,7 @@ propgraph_edge_get_ref_keys(ParseState *pstate, const List *keycols, const List refattnums = array_from_column_list(pstate, refcols, location, ref_rel); keyeqops = palloc_array(Oid, nkeys); - for (i = 0; i < nkeys; i++) + for (int i = 0; i < nkeys; i++) { Oid keytype; int32 keytypmod; @@ -505,8 +504,8 @@ propgraph_edge_get_ref_keys(ParseState *pstate, const List *keycols, const List *outkey = array_from_attnums(nkeys, keyattnums); *outref = array_from_attnums(nkeys, refattnums); - datums = (Datum *) palloc(sizeof(Datum) * nkeys); - for (i = 0; i < nkeys; i++) + datums = palloc_array(Datum, nkeys); + for (int i = 0; i < nkeys; i++) datums[i] = ObjectIdGetDatum(keyeqops[i]); *outeqop = construct_array_builtin(datums, nkeys, OIDOID); } @@ -1629,8 +1628,8 @@ AlterPropGraph(ParseState *pstate, const AlterPropGraphStmt *stmt) Anum_pg_propgraph_label_property_plppropid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(propoid)); - scan = systable_beginscan(rel, InvalidOid /* FIXME */ , - true, NULL, 1, key); + /* XXX no suitable index */ + scan = systable_beginscan(rel, InvalidOid, true, NULL, 1, key); if (!systable_getnext(scan)) { ObjectAddress obj; diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 8b4ede6fd82..27d49555ca4 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -8116,7 +8116,7 @@ privilege_target: } | PROPERTY GRAPH qualified_name_list { - PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); + PrivTarget *n = palloc_object(PrivTarget); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PROPGRAPH; diff --git a/src/backend/parser/parse_graphtable.c b/src/backend/parser/parse_graphtable.c index a8769a67b6a..0682f27f359 100644 --- a/src/backend/parser/parse_graphtable.c +++ b/src/backend/parser/parse_graphtable.c @@ -3,7 +3,7 @@ * parse_graphtable.c * parsing of GRAPH_TABLE * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * diff --git a/src/backend/rewrite/rewriteGraphTable.c b/src/backend/rewrite/rewriteGraphTable.c index 3b319639b81..4f0419e5d44 100644 --- a/src/backend/rewrite/rewriteGraphTable.c +++ b/src/backend/rewrite/rewriteGraphTable.c @@ -3,7 +3,7 @@ * rewriteGraphTable.c * Support for rewriting GRAPH_TABLE clauses. * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION @@ -13,6 +13,7 @@ */ #include "postgres.h" +#include "access/genam.h" #include "access/table.h" #include "access/htup_details.h" #include "catalog/pg_operator.h" diff --git a/src/include/catalog/pg_propgraph_element.h b/src/include/catalog/pg_propgraph_element.h index fea06c0963e..a1c7c07013d 100644 --- a/src/include/catalog/pg_propgraph_element.h +++ b/src/include/catalog/pg_propgraph_element.h @@ -3,7 +3,7 @@ * pg_propgraph_element.h * definition of the "property graph elements" system catalog (pg_propgraph_element) * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_propgraph_element.h diff --git a/src/include/catalog/pg_propgraph_element_label.h b/src/include/catalog/pg_propgraph_element_label.h index 91851a19277..092fc60f47b 100644 --- a/src/include/catalog/pg_propgraph_element_label.h +++ b/src/include/catalog/pg_propgraph_element_label.h @@ -2,7 +2,7 @@ * * pg_propgraph_element_label.h * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_propgraph_element_label.h diff --git a/src/include/catalog/pg_propgraph_label.h b/src/include/catalog/pg_propgraph_label.h index c6b711351b5..54e51ed2579 100644 --- a/src/include/catalog/pg_propgraph_label.h +++ b/src/include/catalog/pg_propgraph_label.h @@ -2,7 +2,7 @@ * * pg_propgraph_label.h * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_propgraph_label.h diff --git a/src/include/catalog/pg_propgraph_label_property.h b/src/include/catalog/pg_propgraph_label_property.h index 2a8bf4feae7..79d20fc353a 100644 --- a/src/include/catalog/pg_propgraph_label_property.h +++ b/src/include/catalog/pg_propgraph_label_property.h @@ -2,7 +2,7 @@ * * pg_propgraph_label_property.h * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_propgraph_label_property.h diff --git a/src/include/catalog/pg_propgraph_property.h b/src/include/catalog/pg_propgraph_property.h index 240b34f0390..5f93dbfa6c5 100644 --- a/src/include/catalog/pg_propgraph_property.h +++ b/src/include/catalog/pg_propgraph_property.h @@ -2,7 +2,7 @@ * * pg_propgraph_property.h * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_propgraph_property.h diff --git a/src/include/commands/propgraphcmds.h b/src/include/commands/propgraphcmds.h index 2440bd4a60c..1bf7d9ea217 100644 --- a/src/include/commands/propgraphcmds.h +++ b/src/include/commands/propgraphcmds.h @@ -3,7 +3,7 @@ * propgraphcmds.h * prototypes for propgraphcmds.c. * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/propgraphcmds.h diff --git a/src/include/parser/parse_graphtable.h b/src/include/parser/parse_graphtable.h index 4cefd5acf9d..e52e21512aa 100644 --- a/src/include/parser/parse_graphtable.h +++ b/src/include/parser/parse_graphtable.h @@ -4,7 +4,7 @@ * parsing of GRAPH_TABLE * * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_graphtable.h diff --git a/src/include/rewrite/rewriteGraphTable.h b/src/include/rewrite/rewriteGraphTable.h index 0c0319f5cfa..2b3be1528e3 100644 --- a/src/include/rewrite/rewriteGraphTable.h +++ b/src/include/rewrite/rewriteGraphTable.h @@ -4,7 +4,7 @@ * Support for rewriting GRAPH_TABLE clauses. * * - * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/rewriteGraphTable.h diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out index eaa436725c1..95e34336f4e 100644 --- a/src/test/regress/expected/create_property_graph.out +++ b/src/test/regress/expected/create_property_graph.out @@ -297,7 +297,7 @@ CREATE PROPERTY GRAPH gc1 DESTINATION KEY (ek2) REFERENCES tc2 (a) DEFAULT LABEL PROPERTIES (ek1, ek2, eb COLLATE pg_catalog.DEFAULT AS eb) ); --- type incosistency check +-- type inconsistency check CREATE TABLE v1 (a int primary key, b text); CREATE TABLE e(k1 text, k2 text, c text); CREATE TABLE v2 (m text, n text); diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql index 6f4dfe1bb00..a976905c5ee 100644 --- a/src/test/regress/sql/create_property_graph.sql +++ b/src/test/regress/sql/create_property_graph.sql @@ -246,7 +246,7 @@ CREATE PROPERTY GRAPH gc1 DEFAULT LABEL PROPERTIES (ek1, ek2, eb COLLATE pg_catalog.DEFAULT AS eb) ); --- type incosistency check +-- type inconsistency check CREATE TABLE v1 (a int primary key, b text); CREATE TABLE e(k1 text, k2 text, c text); -- 2.52.0
