I’m currently working on an Apache-age graph and need to retrieve the OID values for the label relations in the graph. I’m using Postgres to manage my database and have tried querying the ag_labels schema, but it doesn’t seem to contain the OID values for the label relations.
Here’s the code I’ve tried so far:
SELECT oid, relname FROM pg_class WHERE relkind = 'r' AND relname LIKE 'ag_labels_%';
This query returns the relname values for all label relations in my graph, but not the OID values.
I’ve also tried querying the pg_catalog.pg_class table directly, but this doesn’t seem to return the OID values for the label relations either.
I’m wondering if there’s another table or schema I should be looking at to retrieve the OID values for label relations in Apache-age. Any suggestions or insights would be greatly appreciated.
Thanks in advance!
2
Answers
I dont think there is a single query you can run to see all the oids of the existing labels. The labels are stored in the
ag.label
table but that doesn’t hold information about theOID
. What you could try is first querying for all the labels withSELECT * FROM ag_label;
and then run
SELECT oid, relname FROM pg_class WHERE relkind = 'r';
and in the returned rows find the names and oids of the labels you are looking for.
If you run the query:
It will return oids as well like this:
The other condition "relname LIKE ‘ag_labels_%’" might be the reason you are not getting the desired results.