The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [regclass]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
67 views

ERROR: “…” is not a table or materialized view, when creating index in PostgreSQL

I got an error from PostgreSQL (11) when my code tries to CREATE INDEX on a view: ERROR: "_blk_l" is not a table or materialized view To avoid the error, I wanted to check if a regclass object can ...
1
vote
1answer
101 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
204 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 ...
3
votes
2answers
3k 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
235 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
1k 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 ...