public inbox for [email protected]
help / color / mirror / Atom feedType of property graph
2+ messages / 2 participants
[nested] [flat]
* Type of property graph
@ 2026-04-30 12:29 Ashutosh Bapat <[email protected]>
2026-05-04 13:52 ` Re: Type of property graph Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Ashutosh Bapat @ 2026-04-30 12:29 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Hi Peter,
We create a pg_type entry for a property graph, but it's not used
anywhere and it doesn't make sense to create a type for a property
graph which doesn't hold any rows or can be associated with a specific
result type. We have other pg_class entries which do not have a type
associated with them. I think we should do the same for property graph
as well. Here's patch with that change. It doesn't show any failure in
make check as well.
--
Best Wishes,
Ashutosh Bapat
Attachments:
[text/x-patch] v20260430-0001-Do-not-define-type-for-a-property-graph.patch (7.0K, 2-v20260430-0001-Do-not-define-type-for-a-property-graph.patch)
download | inline diff:
From eaa6947952a8dd16dc801360c505bfec53de792f Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <[email protected]>
Date: Thu, 30 Apr 2026 17:35:06 +0530
Subject: [PATCH v20260430 1/6] Do not define type for a property graph
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 <[email protected]>
---
src/backend/catalog/heap.c | 6 ++-
.../expected/create_property_graph.out | 53 +++++++++----------
2 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index d5156c7db62..7678ab13f6a 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -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;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index bc9a596ec89..4fc4759f18e 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -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);
base-commit: 75152c5dc5d38929ddf82f65d5c59eb5a628ab38
--
2.34.1
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Type of property graph
2026-04-30 12:29 Type of property graph Ashutosh Bapat <[email protected]>
@ 2026-05-04 13:52 ` Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2026-05-04 13:52 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; PostgreSQL Hackers <[email protected]>
On 30.04.26 14:29, Ashutosh Bapat wrote:
> We create a pg_type entry for a property graph, but it's not used
> anywhere and it doesn't make sense to create a type for a property
> graph which doesn't hold any rows or can be associated with a specific
> result type. We have other pg_class entries which do not have a type
> associated with them. I think we should do the same for property graph
> as well. Here's patch with that change. It doesn't show any failure in
> make check as well.
Agreed, committed. I included a catversion bump.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-05-04 13:52 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-30 12:29 Type of property graph Ashutosh Bapat <[email protected]>
2026-05-04 13:52 ` Peter Eisentraut <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox