Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CE2C79FB864 for ; Tue, 3 Apr 2007 15:18:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 58009-03 for ; Tue, 3 Apr 2007 15:18:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id DF4E49FB255 for ; Tue, 3 Apr 2007 15:18:32 -0300 (ADT) Received: from a-kretschmer.de (p54b39b92.dip0.t-ipconnect.de [84.179.155.146]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id l33IIRTL007739 for ; Tue, 3 Apr 2007 20:18:27 +0200 Received: from kretschmer by a-kretschmer.de with local (Exim 4.61) (envelope-from ) id 1HYnad-0000vY-Cf for pgsql-sql@postgresql.org; Tue, 03 Apr 2007 20:18:43 +0200 Date: Tue, 3 Apr 2007 20:18:43 +0200 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: plpgsql function question Message-ID: <20070403181843.GB26926@KanotixBox> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/39 X-Sequence-Number: 28039 Karthikeyan Sundaram schrieb: > > Hi, > > I am having a requirement here. > > 1) I need to write a plpgsql function where it takes the input > parameter of a structure of a table. Because? To build this table? You can pass an ascii-text with the table-definition and EXECUTE this string. > 2) The table has 15 columns Okay. And the problem is? > 3) It does lots of validation based on the parameter and finally > returns an integer as output parameters Okay. create function ... returns int as $$ ... return 1; end; $$ language plpgsql; > > Q) How will I passe the table structure as as parameter As i said, for instance as simple text and EXECUTE this. > 2) Do I need to create a type? No. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°