Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to translate USER_OBJECTS.TEMPORARY in PostgreSQL?

I have this code in Oracle:

SELECT *
FROM USER_OBJECTS
WHERE  TEMPORARY = 'N'

I know that the USER_OBJECT table in Postgres is pg_catalog.pg_class, but what’s the equivalent of the TEMPORARY column?
Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

SELECT *
FROM pg_class 
WHERE relpersistence = 't';

REF: https://www.postgresql.org/docs/current/catalog-pg-class.html

relpersistence char
p = permanent table/sequence, u = unlogged table/sequence, t = temporary table/sequence

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading