age icon indicating copy to clipboard operation
age copied to clipboard

One more request for exist type function, this time for vertex and edge, previous was for graph.

Open MironAtHome opened this issue 1 year ago • 1 comments

For all currently maintained branches and postgres / age versions, the behavior of the request

SELECT *
FROM cypher('test_graph', $$
MATCH (v)
	WITH label(v) as vlabel
	   RETURN vlabel
$$) AS t(a agtype);

is to return an label only, if label has rows. If the label is created using SELECT create_vlabel('<graph_name>', '<vertice_name>') vertex will be present, subsequent calls will produce message

ERROR:  label "<vertex_name>" already exists 

SQL state: 3F000

however, until an row is created for this vertex check for existence using query above will produce no rows, as if vertex did not exist. How is it affecting my program. I need to be able to issue call to create and subsequently, whether rows present or not, create an index or set of indexes on the vertex, if vertex already exists. Request: Please chose best variant and create either 1 two function label_exists and label_type, with input parameter label_name 2 two fuctions vertex_exists and edge_exists Personally I would prefer variant 2. It is entirely possible I am missing existing feature that produces similar result. In case team Age could point out, I would be grateful. Otherwise, please help in creating the above approach. To my mind it should be fairly trivial, as function label_exists already present, it just need to be exposed to SQL interface.

MironAtHome avatar Jul 18 '24 17:07 MironAtHome

Functions age_vertex_exists and age_edge_exists are available in the fork under respective branches port/win32msvc/PG14/1.5.1 port/win32msvc/PG16/1.5.1

MironAtHome avatar Jul 19 '24 18:07 MironAtHome

This issue is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days.

github-actions[bot] avatar Sep 18 '24 00:09 github-actions[bot]

This issue was closed because it has been stalled for further 14 days with no activity.

github-actions[bot] avatar Oct 02 '24 00:10 github-actions[bot]