]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Do not define type for a property graph
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 4 May 2026 13:45:56 +0000 (15:45 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 4 May 2026 13:45:56 +0000 (15:45 +0200)
Even though a property graph is defined in pg_class it does not
contain any rows by itself and need not have a type defined. Avoid
creating a type for it.

Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAExHW5ucu7ZTgYkO6rB_1ShJP3e%3DGAT2T3CP4XWN8rUVEsiJoA%40mail.gmail.com

src/backend/catalog/heap.c
src/include/catalog/catversion.h
src/test/regress/expected/create_property_graph.out

index d5156c7db629771848445743bdd7f948da96a399..7678ab13f6a8d5f8653403686542c2a5bdda3403 100644 (file)
@@ -1347,12 +1347,14 @@ heap_create_with_catalog(const char *relname,
        /*
         * Decide whether to create a pg_type entry for the relation's rowtype.
         * These types are made except where the use of a relation as such is an
-        * implementation detail: toast tables, sequences and indexes.
+        * implementation detail: toast tables, sequences, indexes, and property
+        * graphs.
         */
        if (!(relkind == RELKIND_SEQUENCE ||
                  relkind == RELKIND_TOASTVALUE ||
                  relkind == RELKIND_INDEX ||
-                 relkind == RELKIND_PARTITIONED_INDEX))
+                 relkind == RELKIND_PARTITIONED_INDEX ||
+                 relkind == RELKIND_PROPGRAPH))
        {
                Oid                     new_array_oid;
                ObjectAddress new_type_addr;
index 8d5924a32f2048e4da899f22ed050502cb0db7b0..ad6516db53922e43c2d9f4a33757b168d771009a 100644 (file)
@@ -57,6 +57,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     202605011
+#define CATALOG_VERSION_NO     202605041
 
 #endif
index bc9a596ec89a41db96432791d36b4327d2890628..4fc4759f18e71d430cdcbb655a890fde343bcfe3 100644 (file)
@@ -686,11 +686,10 @@ SELECT pg_describe_object(classid, objid, objsubid) as obj,
  property x of property graph g2 | property graph g2
  property y of property graph g2 | property graph g2
  property z of property graph g2 | property graph g2
- type g2                         | property graph g2
  vertex t1 of property graph g2  | property graph g2
  vertex t2 of property graph g2  | property graph g2
  vertex t3 of property graph g2  | property graph g2
-(21 rows)
+(20 rows)
 
 SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
     FROM pg_depend
@@ -719,38 +718,36 @@ SELECT (pg_identify_object_as_address(classid, objid, objsubid)).*
  property graph property | {create_property_graph_tests,g2,x}    | {}
  property graph property | {create_property_graph_tests,g2,y}    | {}
  property graph property | {create_property_graph_tests,g2,z}    | {}
- type                    | {create_property_graph_tests.g2}      | {}
-(21 rows)
+(20 rows)
 
 SELECT (pg_identify_object(classid, objid, objsubid)).*
     FROM pg_depend
     WHERE refclassid = 'pg_class'::regclass AND
           refobjid = 'create_property_graph_tests.g2'::regclass
     ORDER BY 1, 2, 3, 4;
-          type           |           schema            | name |                identity                
--------------------------+-----------------------------+------+----------------------------------------
- property graph element  |                             |      | e1 of create_property_graph_tests.g2
- property graph element  |                             |      | e2 of create_property_graph_tests.g2
- property graph element  |                             |      | t1 of create_property_graph_tests.g2
- property graph element  |                             |      | t2 of create_property_graph_tests.g2
- property graph element  |                             |      | t3 of create_property_graph_tests.g2
- property graph label    |                             |      | e1 of create_property_graph_tests.g2
- property graph label    |                             |      | e2 of create_property_graph_tests.g2
- property graph label    |                             |      | t1 of create_property_graph_tests.g2
- property graph label    |                             |      | t2 of create_property_graph_tests.g2
- property graph label    |                             |      | t3l1 of create_property_graph_tests.g2
- property graph label    |                             |      | t3l2 of create_property_graph_tests.g2
- property graph property |                             |      | a of create_property_graph_tests.g2
- property graph property |                             |      | b of create_property_graph_tests.g2
- property graph property |                             |      | i of create_property_graph_tests.g2
- property graph property |                             |      | j of create_property_graph_tests.g2
- property graph property |                             |      | k of create_property_graph_tests.g2
- property graph property |                             |      | t of create_property_graph_tests.g2
- property graph property |                             |      | x of create_property_graph_tests.g2
- property graph property |                             |      | y of create_property_graph_tests.g2
- property graph property |                             |      | z of create_property_graph_tests.g2
- type                    | create_property_graph_tests | g2   | create_property_graph_tests.g2
-(21 rows)
+          type           | schema | name |                identity                
+-------------------------+--------+------+----------------------------------------
+ property graph element  |        |      | e1 of create_property_graph_tests.g2
+ property graph element  |        |      | e2 of create_property_graph_tests.g2
+ property graph element  |        |      | t1 of create_property_graph_tests.g2
+ property graph element  |        |      | t2 of create_property_graph_tests.g2
+ property graph element  |        |      | t3 of create_property_graph_tests.g2
+ property graph label    |        |      | e1 of create_property_graph_tests.g2
+ property graph label    |        |      | e2 of create_property_graph_tests.g2
+ property graph label    |        |      | t1 of create_property_graph_tests.g2
+ property graph label    |        |      | t2 of create_property_graph_tests.g2
+ property graph label    |        |      | t3l1 of create_property_graph_tests.g2
+ property graph label    |        |      | t3l2 of create_property_graph_tests.g2
+ property graph property |        |      | a of create_property_graph_tests.g2
+ property graph property |        |      | b of create_property_graph_tests.g2
+ property graph property |        |      | i of create_property_graph_tests.g2
+ property graph property |        |      | j of create_property_graph_tests.g2
+ property graph property |        |      | k of create_property_graph_tests.g2
+ property graph property |        |      | t of create_property_graph_tests.g2
+ property graph property |        |      | x of create_property_graph_tests.g2
+ property graph property |        |      | y of create_property_graph_tests.g2
+ property graph property |        |      | z of create_property_graph_tests.g2
+(20 rows)
 
 \a\t
 SELECT pg_get_propgraphdef('g2'::regclass);