Search Postgresql Archives

Re: find column OID types with information schema?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(I had accidentally replied to Tom only on my reply)

the OID's can be found as follows:

SELECT * FROM pg_attribute
  WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mytable');

from this page:
http://www.postgresql.org/docs/8.3/interactive/datatype-oid.html

However, there is no example that uses a schema + tablename.

-Whit

On Mon, Apr 27, 2009 at 11:53 AM, Whit Armstrong
<armstrong.whit@xxxxxxxxx> wrote:
> Thanks, Tom.
>
> So, it's more like this:
>
> select attname, atttypid from pg_attribute where attrelid = <attrelid
> of my table>;
>
> hmm, so how do I find the attrelid of my table?  I don't see it in pg_tables.
>
> -Whit
>
>
>
> On Mon, Apr 27, 2009 at 11:38 AM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
>> Whit Armstrong <armstrong.whit@xxxxxxxxx> writes:
>>> Is it possible to find out the OID types of the columns of a table
>>> using the information schema?
>>
>> No.  Type OIDs are a Postgres-ism so they are not reflected in the
>> standards-mandated contents of the information_schema.  If you want
>> OIDs you'll need to look at the underlying catalogs (pg_attribute
>> in particular).
>>
>>                        regards, tom lane
>>
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux