After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 143576 - postgres: SCHEMA_FIELDS gives strange default-value values.
postgres: SCHEMA_FIELDS gives strange default-value values.
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: PostgreSQL provider
2.99.x
Other Linux
: Normal normal
: ---
Assigned To: malerba
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-06-02 13:00 UTC by Murray Cumming
Modified: 2009-01-28 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2004-06-02 13:00:17 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.
Comment 1 Murray Cumming 2004-06-02 13:01:41 UTC
I mean, 
  'abd'::character varying
Comment 2 malerba 2007-04-19 14:41:06 UTC
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.
Comment 3 Murray Cumming 2007-04-19 15:04:10 UTC
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.
Comment 4 malerba 2009-01-28 13:39:14 UTC
This is now fixed in svn trunk rev #3304