Re: [gnome-db] Patch for postgres provider
- From: Gonzalo Paniagua Javier <gonzalo gnome-db org>
- To: Gnome-db list <gnome-db-list gnome org>
- Subject: Re: [gnome-db] Patch for postgres provider
- Date: Mon, 11 Mar 2002 00:52:19 +0100
* [ Rodrigo Moya <rodrigo gnome-db org>
* Sat, 09 Mar 2002 01:31:34 +0100 ]
> > pg_res = PQexec (pconn, "SELECT oid, typname FROM pg_type "
> > "WHERE typrelid = 0 AND typname !~ '^_' "
> >
> is the oid field present in pg_type for 7.2? If so, why in pg_type and
> not in pg_attribute?
> But well, if it works in 7.2 and also in previous versions, that's ok.
Under psql, when I type '\d pg_type', it doesn't show the oid
column, but 'select oid from pg_type;' works ok.
> > + nrows = PQntuples (pg_res);
> > + td = g_new0 (GdaPostgresTypeOid, nrows);
> > + for (i = 0; i < nrows; i++) {
> > + td[i].name = g_strdup (PQgetvalue (pg_res, i, 1));
> > + td[i].oid = atoi (PQgetvalue (pg_res, i, 0));
> > }
> heh, very nice way to deal with this. But, could you retrieve more info
> from the types? That is, in the SCHEMA_TYPES, right now we are just
> getting the names of the types, but we are going to extend this and get
> extra information. So, it would be nice if you could store as much info
> as possible in td[].
This data is used in the recordsets resulting from the
connection just to map gda <-> postgres types.
The data for SCHEMA_TYPES uses this mapping but gets its data
from another query (see the still-unfinished
gda_postgres_fields_metadata()).
[...]
> > - type_list = get_connection_type_list (pconn);
> > - if (type_list == NULL) {
> > + priv_data = g_new0 (GdaPostgresConnectionPrivate, 1);
> > + priv_data->pconn = pconn;
> > + if (get_connection_type_list (pconn, priv_data) != 0) {
> >
> if priv_data->pconn is already set to 'pconn', why do you need both
> parameters in the call to gda_connection_type_list?
Wow! When you review code, you REALLY do it! Again, you are
right.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]