System catalog and identifying

From: ville80(at)salo(dot)salonseutu(dot)fi (9902468)
To: pgsql-general(at)postgresql(dot)org
Subject: System catalog and identifying
Date: 2002-08-01 09:09:02
Message-ID: c8493963.0208010109.49542500@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all! Didn't find any info on this, so if I missed it please guide
me to the info thx.

I know the name of the table and now I need to know what columns this
table has.

First I search system catalog named pg_class inorder to get the
postgre id of the table named relfilenode:

select relfilenode from pg_class where relname = 'table_name';

after that I search all column names from pg_attribute, like this:

select attname from pg_attribute where attrelid = relfilenode;

unfortunately, this returns correct names, but also some names that
the system uses. How can I exclude these names?

EXAMPLE:
I get the following results:

tableoid *
cmax *
xmax *
cmin *
xmin *
oid *
ctid *
sarake_id
nimi
kuvaus
tyyppi
help
taulu_id

everything marked with * is unwanted.

Thanks beforehand!

-9902468

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karel Zak 2002-08-01 09:18:01 Re: to_char(0,'FM990D99') = "0." instead of "0"
Previous Message frbn 2002-08-01 07:57:53 Re: problem insert time into column timestamp