ZF-3972: Wrong value for "Default value" in describeTable at pgsql adapter
Description
In a column defined as :
"COLUMNNAME" character(10) NOT NULL DEFAULT 'ABCDE12345'::character varying
the value returned by describeTable method for the "DEFAULT" metadata is "'ABCDE12345'::character varying" instead "ABCDE12345" as other adapters (mysql,...)
Comments
Posted by Ralph Schindler (ralph) on 2008-08-29T09:07:44.000+0000
Is it possible if you can provide the CREATE table sql and the expected var_dump output of the descriptTable method?
That would help immensely as I am not an expert in the ways of pgsql ;)
-ralph
Posted by blas lopez (blas) on 2008-08-30T00:59:43.000+0000
The create table statement can be something like :
CREATE TABLE mytable ( pkfield character varying(4) NOT NULL, charfield character varying(1) NOT NULL DEFAULT 'A'::character varying, intfield bigint NOT NULL DEFAULT 1, CONSTRAINT mytable_pkey PRIMARY KEY (pkfield ) ) WITHOUT OIDS;
The expected default value : - for charfield is "A" instead "'A'::character varying" - for intfield is "1" and it is OK.
You can Test it using another DB adapter (eg mysql) with the correspondig create table:
CREATE TABLE mytable ( pkfield varchar(4) NOT NULL, charfield varchar(1) NOT NULL DEFAULT 'A' intfield bigint NOT NULL DEFAULT 1, CONSTRAINT mytable_pkey PRIMARY KEY (pkfield ) )
HTH,
blas
Posted by Mickael Perraud (mikaelkael) on 2009-10-18T06:10:05.000+0000
Corrected with SVN18645