Re: [gnome-db] Postgres: listing tables in a database



On Thu, 2004-11-25 at 21:32 +0100, Murray Cumming wrote:
> I am trying to get a list of the tables in each database on my Postgres
> server. I'm not sure how I'm meant to do this. I see two possibilities:
> 
> 1. Use gda_connection_get_schema() with GDA_CONNECTION_SCHEMA_TABLES.
> According to this page, it takes a "name" parameter:
> http://www.gnome-db.org/docs/libgda/libgda-provider-class.html
> 
> The page says that the parameter is a table name, but that makes no
> sense to me, so I hope it's actually a database name, but it seems to
> return the same list of tables regardless of the name parameter.
> 
it is a table name, in case you want the information for only one table.
If NULL, it returns all info for all tables in the database

> 
> 2. Use gda_connection_set_database(), hoping that it changes the
> behaviour of gda_connection_get_schema() with
> GDA_CONNECTION_SCHEMA_TABLES. But that does not seem to be implemented
> for Postgres:
> 
> ** (libgdamm example:8312): CRITICAL **: file gda-server-provider.c:
> line 276 (gda_server_provider_change_database): assertion `CLASS
> (provider)->change_database != NULL' failed
> 
it's not implemented in the postgres provider :( Either add the
implementation, or create a new GdaConnection for each database you want
to access.
-- 
Rodrigo Moya <rodrigo gnome-db org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]