[Pkg-postgresql-private] RE: Bug#226294: postgresql: Do not just do s/DEFAULT 'now'/DEFAULT now()/g!

Julian Mehnle julian@mehnle.net
Thu, 1 Apr 2004 13:44:57 +0200


Hi all,

Martin Pitt wrote:
> On 2004-04-01 13:12 +0200, Julian Mehnle wrote:
> > So what if the data reads
> >
> >   This is --
> >   CREATE TABLE foo (bar DEFAULT 'now');
> >   -- valid data.
> >
> > ?
> >
> > You cannot perform replacements without thoroughly parsing the whole
> > SQL dump.
>
> Hmmm, SQL in SQL... Then I guess we have to make the choice between
> breaking people's databases because we did the automatic conversion
> and breaking them because we did it not. :-(

IMO, the most correct thing to do is to make pg_dump generate correct
output ("now()" instead of "'now'") in the first place.

Until that happens, offer an automatic database upgrade, *without*
applying any changes to what pg_dump outputs, and warn the user that
pg_dump might produce output that the current PostgreSQL version won't
understand properly (pointing to a README file that describes the
currently known incompatibilities, like the "'now'" thing).