I have created a new Schema in my Postgres db. I want to replace an OID in the pg_class table with the OID of the new Schema. But I don't know where to find the OID of the newly created Schema. Can somebody help me with the right queries?
Postgresql – Where to find the OID of a newly created Schema
metadatapostgresqlqueryschema
Best Answer
Do NOT change the system catalogs manually!
If you want to move a table to a different schema, there is no need to know the oid of the table or the schema:
As documented in the manual you can easily do this through
ALTER TABLE
without having to check or know any oid.