Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA27935 for ; Fri, 25 Feb 2000 11:36:45 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA07622; Fri, 25 Feb 2000 11:36:24 -0500 (EST) To: "Moray McConnachie" cc: pgsql-hackers@postgreSQL.org Subject: Re: missing function datetime() In-reply-to: <006e01bf7f81$b9a91d40$760e01a3@oucs.ox.ac.uk> References: <23337.951436670@sss.pgh.pa.us> <006e01bf7f81$b9a91d40$760e01a3@oucs.ox.ac.uk> Comments: In-reply-to "Moray McConnachie" message dated "Fri, 25 Feb 2000 11:16:10 +0000" Date: Fri, 25 Feb 2000 11:36:23 -0500 Message-ID: <7619.951496583@sss.pgh.pa.us> From: Tom Lane moray.mcconnachie@computing-services.oxford.ac.uk writes: > It looks like replacing all occurrences of datetime with timestamp in > the script works - even for the few functions I have that used the > datetime() function. Oooh --- another case we didn't think about. We really should continue to make a function named datetime() available, even though the type it produces will officially be named timestamp. 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. Not sure which way to jump. Comments anyone? regards, tom lane