X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D0F878BA083 for ; Mon, 14 Feb 2005 14:04:43 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03308-01 for ; Mon, 14 Feb 2005 14:04:39 +0000 (GMT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id 31C7E8BA02E for ; Mon, 14 Feb 2005 14:04:37 +0000 (GMT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Mon Feb 14 15:04:34 2005 +0100 Received: from rodos.fzk.de (resy6.fzk.de [141.52.68.10]) by resy5.fzk.de (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id j1EE4XsG020671; Mon, 14 Feb 2005 15:04:33 +0100 Message-ID: <4210AFEF.412532E8@rodos.fzk.de> Date: Mon, 14 Feb 2005 15:04:31 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: drdani@mazsola.iit.uni-miskolc.hu Cc: pgsql-sql@postgresql.org Subject: Re: copy rows References: <2989532e0502082245c7e50ea@mail.gmail.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS - amavis-milter (http://www.amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.035 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/142 X-Sequence-Number: 20253 I have not been too deep into 8.0, but AFAIK from the 7.x releases, the only way to do things like you describe, is do it the hard way: use SELECT INTO to get the field values you want into variables modify the necessary field values do the INSERT via Executing A Dynamic Command Inserting a record type variable has been brought up before, but IIRC this is not possible. You may like to search the archives. HTH Regards, Christoph drdani@mazsola.iit.uni-miskolc.hu wrote: > > Hi, > > What is the simplest solution in plpgsql to copy some rows in a table? > > I would like to do something like: > > select some rows > do for each row > skip serial field \ > modify one field |-- what is the simplest way for this? > insert as new row / > > Is it possible to insert a record type variable? If yes, how to skip a > field? > > Daniel >