Received: from localhost (IDENT:root@hectic-2.jpl.nasa.gov [128.149.68.204]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA33405 for ; Mon, 28 Feb 2000 11:16:25 -0500 (EST) (envelope-from lockhart@alumni.caltech.edu) Received: from alumni.caltech.edu (lockhart@localhost [127.0.0.1]) by localhost (8.8.7/8.8.7) with ESMTP id QAA09506; Mon, 28 Feb 2000 16:26:42 GMT Sender: lockhart@hub.org Message-ID: <38BAA1C2.65971352@alumni.caltech.edu> Date: Mon, 28 Feb 2000 16:26:42 +0000 From: Thomas Lockhart X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: Moray McConnachie , pgsql-hackers@postgreSQL.org Subject: Re: [HACKERS] Re: missing function datetime() References: <23337.951436670@sss.pgh.pa.us> <006e01bf7f81$b9a91d40$760e01a3@oucs.ox.ac.uk> <7619.951496583@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > 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