Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MironAtHome opened this issue Jul 18, 2024 · 3 comments
Labels
enhancement New request Stale Stale issues/PRs

Comments

@MironAtHome
Copy link

MironAtHome commented Jul 18, 2024

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 MironAtHome added the enhancement New request label Jul 18, 2024
@MironAtHome MironAtHome changed the title One more request for exist type function, this time for vertice(s) and edge(s), previous was for graph. One more request for exist type function, this time for vertex and edge, previous was for graph. Jul 18, 2024
@MironAtHome
Copy link
Author

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

Copy link

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 github-actions bot added the Stale Stale issues/PRs label Sep 18, 2024
Copy link

github-actions bot commented Oct 2, 2024

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New request Stale Stale issues/PRs
Projects
None yet
Development

No branches or pull requests

1 participant