[gnome-db] Re: gnome-db-list digest, Vol 1 #1171 - 7 msgs



On Fri, 16 Apr 2004 gnome-db-list-request gnome org wrote:

> could you please send this patch as an attachment, in unified form (cvs
> -z3 diff -u) and with a ChangeLog entry? Hope it's not asking too
> much :-)

OK, I tried (see the attachments). Is this what you meant? That is a diff
for the current file I've checked out from the CVS.

> > 3. Is there or should there be a way to find out whether a field is
> > serial/auto_increment?
> >
> hmm, good question. What would be the best way?

No idea. You think it should be done the lame way, by defining some column
in the GdaDataModel of the fields' schema and making the providers fill it
based on whatever way the particular RDBMS defines those?

-- 
With respect, Denis Loginov
Index: gda-postgres-provider.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/postgres/gda-postgres-provider.c,v
retrieving revision 1.60
diff -u -r1.60 gda-postgres-provider.c
--- gda-postgres-provider.c	24 Aug 2003 04:11:07 -0000	1.60
+++ gda-postgres-provider.c	16 Apr 2004 17:31:22 -0000
@@ -1656,19 +1656,19 @@
 
 	if (priv_data->version_float < 7.3)
 		query = g_strdup_printf (
-			"(SELECT a.attname, b.typname, a.atttypmod, b.typlen, not a.attnotnull, d.adsrc, "
+			"(SELECT a.attname, b.typname, a.atttypmod, b.typlen, a.attnotnull, d.adsrc, "
 			"a.attnum FROM pg_class c, pg_attribute a, pg_type b, pg_attrdef d "
 			"WHERE c.relname = '%s' AND a.attnum > 0 AND "
 			"a.attrelid = c.oid and b.oid = a.atttypid AND "
 			"a.atthasdef = 't' and d.adrelid=c.oid and d.adnum=a.attnum) "
-			"UNION (SELECT a.attname, b.typname, a.atttypmod, b.typlen, not a.attnotnull, NULL, "
+			"UNION (SELECT a.attname, b.typname, a.atttypmod, b.typlen, a.attnotnull, NULL, "
 			"a.attnum FROM pg_class c, pg_attribute a, pg_type b "
 			  "WHERE c.relname = '%s' AND a.attnum > 0 AND "
 			"a.attrelid = c.oid and b.oid = a.atttypid AND a.atthasdef = 'f') ORDER BY 7",
 			tblname, tblname);
 	else 
 		query = g_strdup_printf (
-			"SELECT a.attname, t.typname, a.atttypmod, t.typlen, not a.attnotnull, d.adsrc, a.attnum "
+			"SELECT a.attname, t.typname, a.atttypmod, t.typlen, a.attnotnull, d.adsrc, a.attnum "
 			"FROM pg_catalog.pg_class c "
 			"LEFT JOIN pg_catalog.pg_attribute a ON (a.attrelid = c.oid) "
 			"FULL JOIN pg_catalog.pg_attrdef d ON (a.attnum = d.adnum AND d.adrelid=c.oid) "
2004-04-16  Denis Loginov <dloginov crl nmsu edu>

    * providers/postgres/gda-postgres-provider.c (gda_postgres_fill_md_data):
    Fixed the "Not Null?" columns, so that it indeed returns the "Not null"
    and not its inverse.


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