Обсуждение: list tables

Поиск
Список
Период
Сортировка

list tables

От
"Luiz Rafael Culik Guimaraes"
Дата:
Dear Friends

How to get all tables associated with an database via C api

[]´s

Luiz Rafael Culik
http://sites.uol.com.br/culikr


Re: list tables

От
"Nigel J. Andrews"
Дата:
On Mon, 12 Aug 2002, Luiz Rafael Culik Guimaraes wrote:

> Dear Friends
>
> How to get all tables associated with an database via C api
>

You can get the query using the psql command line based interface by invoking
it with the extra options: -E -l

Or you could use: SELECT * FROM pg_database

To find out the C API you could read the PERL manpage, man Pg, and use the
header file .../include/libpq-fe.h to match the PERL names/descriptions to the
C functions. Alternatively, I think there is section in one of the HTML
documents found through .../doc/html/index.html that describes the C API.


--
Nigel J. Andrews
Telephone: +44 (0) 208 941 1136




Re: list tables

От
"Nigel J. Andrews"
Дата:
On Tue, 13 Aug 2002, Nigel J. Andrews wrote:

> On Mon, 12 Aug 2002, Luiz Rafael Culik Guimaraes wrote:
>
> > Dear Friends
> >
> > How to get all tables associated with an database via C api
> >
>
> You can get the query using the psql command line based interface by invoking
> it with the extra options: -E -l
>
> Or you could use: SELECT * FROM pg_database

Oops, I see I answered a question that wasn't asked and not the one that
was.

The easiest way to see what tables you have is use psql with the -E option to
connect to a database and the issue the \dt command. This will show you the SQL
to list the tables and you can then change the name of the database you are
interested in.

>
> To find out the C API you could read the PERL manpage, man Pg, and use the
> header file .../include/libpq-fe.h to match the PERL names/descriptions to the
> C functions. Alternatively, I think there is section in one of the HTML
> documents found through .../doc/html/index.html that describes the C API.
>
>
>

--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants