Re: How to get tabloid - Mailing list pgsql-novice

From Terry Lee Tucker
Subject Re: How to get tabloid
Date
Msg-id 200509301336.43235.terry@esc1.com
Whole thread Raw
In response to Re: How to get tabloid  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
Thank you Michael. I did see the behavior you mentioned when two sessions had
temp tables with the same name. Your way is much better.

On Friday 30 September 2005 01:30 pm, Michael Fuhr saith:
> On Fri, Sep 30, 2005 at 06:53:25AM -0400, Terry Lee Tucker wrote:
> > To answer at least part of my own question:
> >
> > SELECT oid FROM pg_class WHERE relname = 'cust';
> >
> > apparently gives the tableoid.
>
> This query should restrict its results with pg_table_is_visible() --
> otherwise you might get the wrong oid if the temporary table has
> the same name as a non-temporary table, or if multiple sessions
> have temporary tables with the same name.
>
> Here's another way:
>
> SELECT 'cust'::regclass::oid;
>
> --
> Michael Fuhr

--

pgsql-novice by date:

Previous
From: Kretschmer Andreas
Date:
Subject: Re: Interval fields
Next
From: "Walker, Jed S"
Date:
Subject: Transaction within plpgsql