Re: [GENERAL] timestamp default values

2005-08-07 Thread Alvaro Herrera
On Sun, Aug 07, 2005 at 12:47:19AM -0400, Tom Lane wrote: > BTW: at least with our current interpretation of these datatypes, the > only type that is sensible for a now()-like function to return is > timestamptz. Not plain timestamp; that cannot be considered to > represent a well-defined instant

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
> [ shrug... ] This is just a variant of the choose-a-new-function-name > game. If we are going to choose a new function name, choosing one that > collides with an existing name (obsolete or not) doesn't seem like a > win to me. You could just as well choose another name, and avoid > angering wh

Re: [GENERAL] timestamp default values

2005-08-06 Thread Tom Lane
Brendan Jurd <[EMAIL PROTECTED]> writes: > If the current implementation of timenow() is truly obsolete, would it > be verboten to change its return type? We could rewrite the function > to return timestamp, for example. [ shrug... ] This is just a variant of the choose-a-new-function-name game.

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
> I'd be interested to see how you do that, considering that abstime > can't store fractional seconds. timenow() is even more obsolete than > timeofday() --- AFAICS it's not documented at all, anywhere. The whole > abstime datatype is obsolete, actually, and will have to go away > sometime before

Re: [GENERAL] timestamp default values

2005-08-06 Thread Tom Lane
Brendan Jurd <[EMAIL PROTECTED]> writes: > Does anybody know why this function returns text? The documentation > cites "historical reasons". Are any of those historical reasons still > relevant? Backwards compatibility --- changing the result datatype would surely break some applications. I'm a

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
On 8/7/05, Tom Lane <[EMAIL PROTECTED]> wrote: > Brendan Jurd <[EMAIL PROTECTED]> writes: > > Are there any good reasons why the output of timeofday() needs to > > include the three letter day-of-week? > > If we are going to change it, I'd be inclined to make it output the > canonical ISO format (

Re: [GENERAL] timestamp default values

2005-08-06 Thread Tom Lane
Brendan Jurd <[EMAIL PROTECTED]> writes: > Are there any good reasons why the output of timeofday() needs to > include the three letter day-of-week? If we are going to change it, I'd be inclined to make it output the canonical ISO format (-MM-DD HH:MM:SS.-TZ). Or perhaps the format should

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
Here we go ... line 498 of backend/utils/adt/datetime.c: /* Used for SET australian_timezones to override North American ones */ static datetkn australian_datetktbl[] = { {"acst", TZ, POS(38)}, /* Cent. Australia */ {"cst", TZ, POS(42)}, /* Australia Central Std

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
On 8/7/05, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Sun, Aug 07, 2005 at 12:05:43PM +1000, Brendan Jurd wrote: > > => select 'Sat Aug 06 12:00:43.668919 2005 EST'::timestamp; > > ERROR: 22007: invalid input syntax for type timestamp: "Sat Aug 06 > > 12:00:43.668919 2005 EST" > > What are your

Re: [GENERAL] timestamp default values

2005-08-06 Thread Michael Fuhr
On Sun, Aug 07, 2005 at 12:05:43PM +1000, Brendan Jurd wrote: > => select 'Sat Aug 06 12:00:43.668919 2005 EST'::timestamp; > ERROR: 22007: invalid input syntax for type timestamp: "Sat Aug 06 > 12:00:43.668919 2005 EST" What are your timezone and australian_timezones settings? I can duplicate t

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
On 8/7/05, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Sat, Aug 06, 2005 at 10:06:35AM -0400, Tom Lane wrote: > > Can anyone else duplicate the problem? > > I couldn't duplicate the problem in 8.0.2 or in any other version > from 7.2.8 through HEAD (latest CVS for all). > > Brendan, if you execu

Re: [GENERAL] timestamp default values

2005-08-06 Thread Michael Fuhr
On Sat, Aug 06, 2005 at 10:06:35AM -0400, Tom Lane wrote: > Can anyone else duplicate the problem? I couldn't duplicate the problem in 8.0.2 or in any other version from 7.2.8 through HEAD (latest CVS for all). Brendan, if you execute "\set VERBOSITY verbose" in psql and then generate the errors,

Re: [GENERAL] timestamp default values

2005-08-06 Thread Tom Lane
Brendan Jurd <[EMAIL PROTECTED]> writes: > On 8/6/05, Tom Lane <[EMAIL PROTECTED]> wrote: >> Brendan Jurd <[EMAIL PROTECTED]> writes: >>> timeofday() returns text, and moreover it returns in a bizarre format >>> which cannot be converted directly into any useful temporal types, at >>> least not in

Re: [GENERAL] timestamp default values

2005-08-06 Thread Brendan Jurd
On 8/6/05, Tom Lane <[EMAIL PROTECTED]> wrote: > Brendan Jurd <[EMAIL PROTECTED]> writes: > > timeofday() returns text, and moreover it returns in a bizarre format > > which cannot be converted directly into any useful temporal types, at > > least not in 8.0.2: > > Hm? Works fine for me. What da

Re: [GENERAL] timestamp default values

2005-08-05 Thread Tom Lane
Brendan Jurd <[EMAIL PROTECTED]> writes: > timeofday() returns text, and moreover it returns in a bizarre format > which cannot be converted directly into any useful temporal types, at > least not in 8.0.2: Hm? Works fine for me. What datestyle setting do you have exactly?

[GENERAL] timestamp default values

2005-08-05 Thread Brendan Jurd
Hi all, I have a table which is used for logging, and I want a timestamp column which reliably stores the insert time for each row inside a transaction, with maximum precision. Now, if I'm reading the documentation (http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html#FUNCTIONS-