Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4E3811337999 for ; Tue, 1 Feb 2011 15:37:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 93872-05 for ; Tue, 1 Feb 2011 19:37:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id D859A133616B for ; Tue, 1 Feb 2011 15:37:32 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p11JZ15d001162; Tue, 1 Feb 2011 14:35:01 -0500 (EST) To: Steve White cc: Kevin Grittner , pgsql-bugs@postgresql.org Subject: Re: Feature request: include script file into function body (better syntax) In-reply-to: <20110201190927.GB7511@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> Comments: In-reply-to Steve White message dated "Tue, 01 Feb 2011 20:09:27 +0100" Date: Tue, 01 Feb 2011 14:35:01 -0500 Message-ID: <1161.1296588901@sss.pgh.pa.us> From: Tom Lane 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/22 X-Sequence-Number: 29294 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. 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. regards, tom lane