Re: showing table and columns

Lists: pgsql-jdbc
From: Mir Shafiqul Islam <mislam(at)mindspring(dot)com>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: showing table and columns
Date: 2002-09-26 20:16:08
Message-ID: 3D936B08.3060007@mindspring.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Is there a way to construct a SQL statement to retrieve all the tables
and also columns information ?

I know, using \d from psql shows the table and \d tablename will show
the columns but that does not work from within jdbc.

Thanks
Mir


From: Daniel Serodio <daniel(at)checkforte(dot)com(dot)br>
To: Mir Shafiqul Islam <mislam(at)mindspring(dot)com>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: showing table and columns
Date: 2002-09-26 20:34:17
Message-ID: 1033072465.27015.1.camel@kelly
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Sure, that's answered in the PostgreSQL FAQ:

<quote>

4.3) How do I get a list of tables or other things I can see in psql?

You can read the source code for psql in file
pgsql/src/bin/psql/describe.c. It contains SQL commands that generate
the output for psql's backslash commands. You can also start psql with
the -E option so it will print out the queries it uses to execute the
commands you give.

</quote>

On Thu, 2002-09-26 at 17:16, Mir Shafiqul Islam wrote:
> Is there a way to construct a SQL statement to retrieve all the tables
> and also columns information ?
>
> I know, using \d from psql shows the table and \d tablename will show
> the columns but that does not work from within jdbc.
>
> Thanks
> Mir

--
[]'s
Daniel Serodio


From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Mir Shafiqul Islam <mislam(at)mindspring(dot)com>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: showing table and columns
Date: 2002-09-26 20:49:50
Message-ID: 1033073390.1957.106.camel@inspiron.cramers
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

I'm inclined to tell you to read the jdbc api specs, and you should, but
the answer is DatabaseMetaData.getTables, etc.

Dave
On Thu, 2002-09-26 at 16:16, Mir Shafiqul Islam wrote:
> Is there a way to construct a SQL statement to retrieve all the tables
> and also columns information ?
>
> I know, using \d from psql shows the table and \d tablename will show
> the columns but that does not work from within jdbc.
>
> Thanks
> Mir
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>