Friday, August 26, 2022

How to find the oid for a table in PostgreSQL

Connected to the relevant database using the connection tool of your choice, execute the following to find the oid for a table:
mydb # select 'myschema.mytable'::regclass::oid;
   oid
----------
 19561436
(1 row)

No comments:

Post a Comment