Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C381363302F for ; Fri, 19 Mar 2010 11:49:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 76247-01 for ; Fri, 19 Mar 2010 14:48:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id EA358632BE8 for ; Fri, 19 Mar 2010 11:48:53 -0300 (ADT) Received: from [192.168.1.11] (LCaen-151-93-7-26.w80-13.abo.wanadoo.fr [80.13.230.26]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id C77403B8F5; Fri, 19 Mar 2010 15:48:51 +0100 (CET) Message-ID: <4BA38ED3.6070109@lelarge.info> Date: Fri, 19 Mar 2010 15:48:51 +0100 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Julius Tuskenis CC: pgsql-admin@postgresql.org Subject: Re: insert in function writen in pgplsql References: <4BA37FF5.8060001@nsoft.lt> <4BA38833.60804@lelarge.info> <4BA38CA7.3050606@nsoft.lt> In-Reply-To: <4BA38CA7.3050606@nsoft.lt> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.964 tagged_above=-10 required=5 tests=AWL=0.635, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/142 X-Sequence-Number: 33941 Le 19/03/2010 15:39, Julius Tuskenis a écrit : > 2010.03.19 16:20, Guillaume Lelarge rašė: >> Yes. It would also be easier to debug. >> > I guess so, but is there no way to tell the postgres that I'm listing > the field names and there is no place for a parameter in that list... I > tried using INSERT INTO table(table.column .... syntax, but postgres > does not accept that. No, there's no way. > When you write a new function it is not hard to pick the parameter names > you want, but when editing it you have to play with what you have and > sometimes it's a pain.... > I always add prefix to work around this (p_user for example). > One more question Is there a way to use INSERT INTO table($1.... > syntax?? I can't think of such case. Can you provide an example? > You'll find examples and explanations in the fine manual: http://www.postgresql.org/docs/8.4/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN -- Guillaume. http://www.postgresqlfr.org http://dalibo.com