Devrim GUNDUZ said:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Hi,
>
> On Tue, 20 Jan 2004, Alexander Antonakakis wrote:
>
>> How can I get the column names of a table with sql ?
>
> SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%';
>
> will work, I think.
If you want COLUMNS and not TABLES and are using 7.4 then use the views
provided in the information_schema. eg
select column_name from information_schema.columns
where table_name = 'mytable';
Look at the view, you can select all sorts of info, and filter on other
criteria too.
John Sidney-Woollett