Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6C45F1337B43 for ; Tue, 1 Feb 2011 16:04:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 78170-04 for ; Tue, 1 Feb 2011 20:04:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail0.aip.de (maigret.aip.de [141.33.160.2]) by mail.postgresql.org (Postfix) with SMTP id BC2231337B39 for ; Tue, 1 Feb 2011 16:04:11 -0400 (AST) Received: (qmail 31350 invoked from network); 1 Feb 2011 18:58:40 -0000 Received: from cashmere.aip.de (141.33.4.98) by mailout.aip.de with SMTP; 1 Feb 2011 18:58:39 -0000 Received: from cashmere.aip.de (localhost.localdomain [127.0.0.1]) by cashmere.aip.de (8.13.8/8.13.8) with ESMTP id p11K4ACo008341; Tue, 1 Feb 2011 21:04:10 +0100 Received: (from swhite@localhost) by cashmere.aip.de (8.13.8/8.13.8/Submit) id p11K4Af2008340; Tue, 1 Feb 2011 21:04:10 +0100 X-Authentication-Warning: cashmere.aip.de: swhite set sender to swhite@aip.de using -f Date: Tue, 1 Feb 2011 21:04:10 +0100 From: Steve White To: Tom Lane Cc: Kevin Grittner , pgsql-bugs@postgresql.org Subject: Re: Feature request: include script file into function body (better syntax) Message-ID: <20110201200410.GB8252@cashmere.aip.de> References: <20110201112120.GA1327@cashmere.aip.de> <26900.1296576145@sss.pgh.pa.us> <20110201164422.GA3023@cashmere.aip.de> <4D47EB12020000250003A0EE@gw.wicourts.gov> <20110201185004.GA7511@cashmere.aip.de> <20110201190927.GB7511@cashmere.aip.de> <1161.1296588901@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1161.1296588901@sss.pgh.pa.us> User-Agent: Mutt/1.4.2.2i "Organization: Astrophysikalisches Institut Potsdam" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/25 X-Sequence-Number: 29297 Hi Tom, I already agreed to Kevin's proposed syntax, and it is better than my suggestion, but mine isn't quite as crazy as you make out. On 1.02.11, Tom Lane wrote: > Steve White writes: > > Try this instead: > > > ================================================ > > CREATE OR REPLACE FUNCTION > > myfunc( ... ) > > RETURNS VOID AS '#PGSQL_IMPORT filename' LANGUAGE PLPYTHONU; > > ================================================ > > I think having psql decide that string literals mean something other > than their face value is Right Out --- it would bite you on the rear > just when you least expect it. Interesting idea... but why would psql make this decision? Did somebody suggest that off-line? I said that the script interpreter might do this... But the other syntax is better anyway. > And the notion of the behavior being > language-dependent is right out to the fourth power. But see my > alternative proposal to Kevin just now. > -- | - - - - - - - - - - - - - - - - - - - - - - - - - | Steve White +49(331)7499-202 | E-Science Zi. 27 Villa Turbulenz | - - - - - - - - - - - - - - - - - - - - - - - - - | Astrophysikalisches Institut Potsdam (AIP) | An der Sternwarte 16, D-14482 Potsdam | | Vorstand: Prof. Dr. Matthias Steinmetz, Peter A. Stolz | | Stiftung privaten Rechts, Stiftungsverzeichnis Brandenburg: III/7-71-026 | - - - - - - - - - - - - - - - - - - - - - - - - -