Re: Porting from MySql - meta data issues

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Geoff Caplan <geoff(at)advantae(dot)com>, Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Porting from MySql - meta data issues
Date: 2002-04-05 15:44:49
Message-ID: 20020405154449.10223.qmail@web20803.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The answers you have already had are good ones.
To add to those: you can find more details about the
system tables here:

http://www5.uk.postgresql.org/users-lounge/docs/7.2/postgres/catalogs.html

--- Geoff Caplan <geoff(at)advantae(dot)com> wrote:
> Hi folks
>
> I'm porting quite a big PHP application from MySql
> and have hit an issue.
>
> 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.
>
> The only option I have come up with is to shell out
> to psql, run \l and \d
> commands, and use a regex to parse the strings
> returned. Clearly, this
> would be a bit of a hack, and not resource
> efficient.
>
> Can any kind person suggest a more effective
> approach? I am brand new to
> Postgres, and doing this under considerable time
> pressure, so apologies if
> I am missing anything obvious - I can't find
> anything in the docs, or in
> the articles on porting from MySQL...
>
>
> Geoff Caplan
> Advantae Ltd
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Caplan 2002-04-05 16:13:40 Re: Porting from MySql - meta data issues
Previous Message Tom Lane 2002-04-05 15:15:52 Re: Dead devel-corner links