Questions tagged [regclass]

regclass is one of the Object Identifier (OID) alias Types in PostgreSQL.

Filter by
Sorted by
Tagged with
1
vote
1answer
126 views

Missing “public” schema when converting a “regclass” value to text

I am writing a script in which I need to parse the name of a table (in regclass). The parsing (with parse_ident()) works so far. However, the script fails when the table is in the public schema ...
3
votes
1answer
222 views

Test if a string is a valid, unquoted identifier?

I'm just wondering if there is an established method for testing if a string can be used as an unquoted PostgreSQL identifier? (unquoted because almost any string can be a quoted identifier). I ask ...
4
votes
2answers
4k views

How to get the schema name of a table of type regclass in PostgreSQL?

In writing a function to test if a column col_name exists in a table _tbl, I'd like to extract the table's schema name, which is passed into the function as a regclass parameter (for security??). ...
4
votes
2answers
275 views

PostgreSQL: Do regclass/oid columns persist across backups?

I have a large table (audit) in which I store relation ID of the schema and table. This is conveniently populated by trigger using TG_RELID. It is also convenient because I can index it and the index ...
5
votes
2answers
2k views

PL/pgSQL regclass quoting of table named like keyword

I want to create a new table name based on an existing one by appending a suffix to it. A Postgres 9.5 PL/pgSQL function gets the existing table name passed in as regclass type and returns the new ...