ZF-3972: Wrong value for "Default value" in describeTable at pgsql adapter

Issue Type: Bug Created: 2008-08-16T08:43:41.000+0000 Last Updated: 2009-10-18T06:10:23.000+0000 Status: Resolved Fix version(s): - 1.9.5 (27/Oct/09)

Reporter: blas lopez (blas) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db

Related issues: Attachments:


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,...)


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 ;)


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 ) )



Posted by Mickael Perraud (mikaelkael) on 2009-10-18T06:10:05.000+0000

Corrected with SVN18645

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.