Re: Quick System Catalog Query Question

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: Terry Hampton <thampton(at)limacorp(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Quick System Catalog Query Question
Date: 2004-03-30 16:52:29
Message-ID: m3r7vawadv.fsf@conexa.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Terry Hampton <thampton(at)limacorp(dot)com> writes:

> Manuel,
>
> Many thanks for your quick reply. When I
> enter: SELECT * FROM pg_type where typname='varchar';
>
> I get:
>
> typname | typowner | typlen | typprtlen | typbyval | typtype | typisdefined
> | typdelim | typrelid | typelem | typinput | typoutput | typreceive |
> typsend | typalign | typstorage | typdefault
>
> ---------+----------+--------+-----------+----------+---------+--------------+----------+----------+---------+-----------+------------+------------+------------+----------+------------+------------
> varchar | 1 | -1 | -1 | f | b | t | ,
> | 0 | 0 | varcharin | varcharout | varcharin | varcharout | i
> | x |
>
>
>
> I do not see "1043", thus my original email.

OID, among others is a hidden column, you need to explicitly ask for
it in your query:

SELECT oid, * FROM pg_type WHERE typname='varchar';

>
> I'm just now starting to work with OID's. Does every row
> in the system catalogs have an OID?

Most of them.

> reference to another tablename.oid - to get the actual name, simply
> use the known OID from the first table as a lookup value into the
> second ( reference table ), to get the textual vlaue. ? Correct ?

Correct.

Regards,
Manuel.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ben Kim 2004-03-30 17:46:27 tweaking scan.l
Previous Message Andrew Biagioni 2004-03-30 16:00:04 Re: Spontaneous PostgreSQL Server Reboot?