Re: How to get tabloid

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Terry Lee Tucker <terry(at)esc1(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to get tabloid
Date: 2005-09-30 17:30:28
Message-ID: 20050930173028.GA6035@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Terry Lee Tucker 2005-09-30 17:36:43 Re: How to get tabloid
Previous Message XXXXX XXXXXXXXXXXXXXX 2005-09-30 17:21:52 8.0.3 Installation Error On WinXP SP2