Re: copy rows

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: drdani(at)mazsola(dot)iit(dot)uni-miskolc(dot)hu
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: copy rows
Date: 2005-02-14 14:04:31
Message-ID: 4210AFEF.412532E8@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)mazsola(dot)iit(dot)uni-miskolc(dot)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
>

In response to

  • copy rows at 2005-02-09 07:53:39 from drdani

Browse pgsql-sql by date

  From Date Subject
Next Message AL ELK 2005-02-14 15:42:27 triggers
Previous Message George Weaver 2005-02-14 13:38:46 Re: Working with XML.