Clarification on pg_attribute attrelid

From: Mike Martin <redtux1(at)gmail(dot)com>
To: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Clarification on pg_attribute attrelid
Date: 2020-09-11 11:26:44
Message-ID: CAOwYNKYJ-MkzvEbfnHGFpYEisZUz6iE4-md3z5b0ZPV-7dZ_1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is it correct that calling attrelid::regclass will always return a
non-schema qualified relation name
ie:
WHERE there is a temp table and a permanent table of the the same name
SELECT attrelid::regclass
FROM pg_attribute
WHERE attrelid = 'tagdata'::regclass

will always use the "current" temp table of the name or the permanent
table if no temp table exists without schema qualification.

So this would be the same as a normal select , ie:uses temp table/permanent
table as appropriate

thanks

Mike

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2020-09-11 14:12:44 Re: Clarification on pg_attribute attrelid
Previous Message Iuri Sampaio 2020-09-07 02:03:17 Re: Crossing/Rotating table rows to rows and columns