Re: [HACKERS] Re: missing function datetime() - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: [HACKERS] Re: missing function datetime()
Date
Msg-id 38BAA1C2.65971352@alumni.caltech.edu
Whole thread Raw
In response to Re: missing function datetime()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Re: missing function datetime()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> I can see two ways to do that: either add another function to pg_proc
> (five of them actually :-(), or hack the parser to translate a function
> name 'datetime' to 'timestamp'.  Ugly as the second one sounds, it has
> a couple of advantages.  First, it would provide an automatic upgrade
> path: future dumps of 7.0 databases would show the correct function
> name, at least for uses in rules.  So we could hope to get rid of the
> compatibility hack someday.  Second, the parser has special treatment
> for functions that are named the same as datatypes --- it knows they
> represent type coercions --- so a function named "datetime" won't really
> work quite the way it should for type resolution.

xlateSqlFunc() is already in gram.y; enjoy...
                 - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] NOT NULL doesn't work in v7
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: missing function datetime()