GNOME Bugzilla – Bug 143576
postgres: SCHEMA_FIELDS gives strange default-value values.
Last modified: 2009-01-28 13:39:14 UTC
If I give a field a default value with a sql command like so: ALTER TABLE tblexample ALTER COLUMN name_first SET DEFAULT 'abd'; And then read the default value back with gda_connection_get_schema(GDA_CONNECTION_SCHEMA_FIELDS, param_with_table_name) then the default value column will have a GdaValue, of type string, with this text: 'yadda'::character varying By the way, that does not seem to be something that you can use in the original ALTER_TABLE sql statement.
I mean, 'abd'::character varying
Why would that be wrong? I just checked, and that syntax is fully supported by Postgres: create table tblexample (name_first varchar (20) DEFAULT 'abd'::character varying); is valid.
Well, I was surprised that this "::character varying" thing was given back by libgda. It's postgres-specific (and meaningless to me). Surely, I shouldn't have to watch out for various different syntaxes depending on the server I'm using? I don't mind too much if libgda accepts this syntax, though I wonder how I would provide a default value that included "::", but I don't expect to see it given back to me in a generic API.
This is now fixed in svn trunk rev #3304