Re: [BUGS] BUG #1938: pg_dump mis-intreprets "default now()";

2005-10-06 Thread Jeff MacDonald

Thanks !

Jeff.

Michael Fuhr wrote:

On Tue, Oct 04, 2005 at 08:29:23PM +0100, Jeff MacDonald wrote:


I did a backup from 7.3.2 using pg_dumpall.

When I did a restore all of my timestamps that were defaulted to now(); were
now defaulted to the time that I piped my dump back into postgres.

Meaning the now() was parsed instead of just being copied.



Are you sure the default was now() and not 'now'?  If you still
have the 7.3.2 server running then check the table definitions.
Aside from using psql's \d commands, you could do this:

SELECT adrelid::regclass, adnum, adsrc
FROM pg_attrdef
ORDER BY adrelid, adnum;

The 7.3 documentation warns against using 'now', and the 7.4 Release
Notes mention a behavior change with respect to column defaults.

http://www.postgresql.org/docs/7.3/interactive/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
http://www.postgresql.org/docs/7.4/interactive/release-7-4.html



---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [BUGS] BUG #1938: pg_dump mis-intreprets "default now()";

2005-10-05 Thread Michael Fuhr
On Tue, Oct 04, 2005 at 08:29:23PM +0100, Jeff MacDonald wrote:
> I did a backup from 7.3.2 using pg_dumpall.
> 
> When I did a restore all of my timestamps that were defaulted to now(); were
> now defaulted to the time that I piped my dump back into postgres.
> 
> Meaning the now() was parsed instead of just being copied.

Are you sure the default was now() and not 'now'?  If you still
have the 7.3.2 server running then check the table definitions.
Aside from using psql's \d commands, you could do this:

SELECT adrelid::regclass, adnum, adsrc
FROM pg_attrdef
ORDER BY adrelid, adnum;

The 7.3 documentation warns against using 'now', and the 7.4 Release
Notes mention a behavior change with respect to column defaults.

http://www.postgresql.org/docs/7.3/interactive/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
http://www.postgresql.org/docs/7.4/interactive/release-7-4.html

-- 
Michael Fuhr

---(end of broadcast)---
TIP 6: explain analyze is your friend


[BUGS] BUG #1938: pg_dump mis-intreprets "default now()";

2005-10-04 Thread Jeff MacDonald

The following bug has been logged online:

Bug reference:  1938
Logged by:  Jeff MacDonald
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.0.3
Operating system:   FreeBSD 5.2.1
Description:pg_dump mis-intreprets "default now()";
Details: 

Hi,

I did a backup from 7.3.2 using pg_dumpall.

When I did a restore all of my timestamps that were defaulted to now(); were
now defaulted to the time that I piped my dump back into postgres.

Meaning the now() was parsed instead of just being copied.

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly