Re: text -> time cast problem

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: text -> time cast problem
Date: 2001-12-10 02:25:40
Message-ID: GNELIHDDFBOCMGBFGEFOIELACAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Just a quick question for 7.1.3:

I notice that where as you can do this:

insert into table values ('now');

To insert a current timestamp, if you try using the more standard syntax:

insert into table values ('CURRENT_TIMESTAMP');

You get the word 'current' inserted. However if you do this:

insert into table values (CURRENT_TIMESTAMP);

It works as expected.

Is there anything wrong with any of these behaviours, and has any of it been
changed for 7.2? I kind think that the quoted CURRENT_TIMESTAMP should work
just like the unquoted...

Chris

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
> Sent: Friday, 7 December 2001 10:21 PM
> To: Brent Verner
> Cc: Peter Eisentraut; PostgreSQL Development; Thomas Lockhart
> Subject: Re: [HACKERS] text -> time cast problem
>
>
> Brent Verner <brent(at)rcfile(dot)org> writes:
> > This seems fair. Would this approach imply that CURRENT_TIME and
> > CURRENT_TIMESTAMP should not apply default precision to their return
> > values? Right now, "CURRENT_TIME" is equivalent to "CURRENT_TIME(0)"
> > and "CURRENT_TIMESTAMP" eq to "CURRENT_TIMESTAMP(6)".
>
> Yes, I had been thinking that myself, but hadn't got round to mentioning
> it to the list yet. (Even if you do accept default precisions for time
> & timestamp columns, I can see nothing in the spec that justifies
> applying those default precisions to CURRENT_TIME/TIMESTAMP. AFAICS,
> the precision of their results when they are given no argument is
> just plain not specified.)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-12-10 02:29:17 Re: pg_dump: Sorted output, referential integrity
Previous Message Christopher Kings-Lynne 2001-12-10 02:20:46 Re: New NLS status page