pg_dump bug with default date

From: "Bryan White" <bryan(at)arcamax(dot)com>
To: <pgsql-general(at)postgreSQL(dot)org>
Subject: pg_dump bug with default date
Date: 1999-03-10 20:27:59
Message-ID: 007401be6b34$7d15ba80$a3f0f6ce@bryan.arcamax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I use pg_dump to back up my database. I recently changed one of my date
fields to have a default value as such:
firstcontactdate date default current_date,

If I pg_dump the database and reload the CREATE statment for this table
fails. pg_dump used this defintion:
"firstcontactdate" "date" DEFAULT date 'current'::datetime + '0 sec'),
PSQL reports:
ERROR: parser: parse error at or near "'"

I can work around this problem by extracting the offending the table create
statement from the script, pre-creating the table with a corrected
definition and ignoring the error when the script tries to create the table.
I don't want to edit the script directly because it is 50MB and growing.
Fortunately the schema statements are all at the front so I can grab them
with "head -1000".

This is Postgres 6.4.0. Is this a known problem? Has it been fixed?

Bryan White
ArcaMax Inc.
Yorktown VA
www.arcamax.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Mercer 1999-03-10 20:58:22 CREATE TEMP tname (fname char);
Previous Message Pavel PaJaSoft Janousek 1999-03-10 20:26:32 Re: [GENERAL] Is it possible to change a columns name