Re: Allowing SYSDATE to Work

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Matt Miller <pgsql(at)mattmillersf(dot)fastmail(dot)fm>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Allowing SYSDATE to Work
Date: 2006-11-17 22:31:07
Message-ID: 20061117223107.GF5293@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Matt Miller wrote:
> I'd like SYSDATE to work syntactically and semantically the same as
> CURRENT_TIMESTAMP (or CURRENT_TIME, or whatever). I can create a
> function called "sysdate" that does the trick, but then it seems I have
> to reference the function as "sysdate ()," but I want to be able to get
> away with just "sysdate." It seems that CURRENT_TIMESTAMP and their
> friends are magic functions that can be referenced without an explicit
> empty argument list.

current_time and the like are hardcoded in the grammar. You'd have to
do the same for sysdate. It's not hard, but then I'd question the
hassle of having to patch all the Postgres installations you're going to
want to run your code on.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2006-11-17 23:16:20 Re: SPI
Previous Message Bob Pawley 2006-11-17 22:26:57 After Update Triggers

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2006-11-17 22:35:28 Re: Proposal: syntax of operation with tsearch's configuration
Previous Message Matt Miller 2006-11-17 22:26:37 Allowing SYSDATE to Work