Zend Framework

Wrong value for "Default value" in describeTable at pgsql adapter

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: N/A N/A
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.9.5
  • Component/s: Zend_Db
  • Labels:
    None

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

Activity

Hide
Ralph Schindler added a comment -

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

Show
Ralph Schindler added a comment - 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
Hide
blas lopez added a comment -

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

Show
blas lopez added a comment - 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
Hide
Mickael Perraud added a comment -

Corrected with SVN18645

Show
Mickael Perraud added a comment - Corrected with SVN18645

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: