Re: Porting from MySql - meta data issues

From: Antti Haapala <antti(dot)haapala(at)iki(dot)fi>
To: Geoff Caplan <geoff(at)advantae(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Porting from MySql - meta data issues
Date: 2002-04-05 19:51:51
Message-ID: Pine.LNX.4.44.0204052245501.20299-100000@calvin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> I have a number of PHP functions in the app which return meta-info about
> the data structure:
>
> list_databases( ) ;
> list_tables( $database_name ) ;
> list_field_names( $table_name ) ;
> is_existing_field( $table_name ) ;
>
> With MySql, this info is readily available using the various SHOW queries,
> but I can't figure out how to do this with Postgres.

Run psql with -E switch and you're able to see internal queries generated
by i.e. \dt and \l commands. Then you can cut'n'paste and modify those
queries to match your requirements.

--
Antti Haapala

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eduardo_Cadena 2002-04-05 20:18:51 Storing & retieving gif/jpeg
Previous Message Doug McNaught 2002-04-05 17:07:56 Re: binary data storage