Re: pgplsql, how to save row variable to a table row

From: John DeSoi <desoi(at)pgedit(dot)com>
To: josep porres <jmporres(at)gmail(dot)com>
Cc: "Craig Ringer" <craig(at)postnewspapers(dot)com(dot)au>, rod(at)iol(dot)ie, pgsql-general(at)postgresql(dot)org
Subject: Re: pgplsql, how to save row variable to a table row
Date: 2008-03-26 14:11:16
Message-ID: 2F91EE19-1431-4CC1-B08C-3EA347C8C9A4@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mar 26, 2008, at 8:59 AM, josep porres wrote:

>
> INSERT INTO demo_tab SELECT demo_tab_row.*;
>
>
> I tried this before with no success.
> But I realized that it was because a problem with a constraint, no
> warnings about this at all.
> With the detailed insert i've got the constraint error.
> I was using the execute because I had a variable called the same as
> a field, not good, I changed it.
> So now it's working perfectly!!!

You don't need SELECT at all:

INSERT INTO demo_tab VALUES (demo_tab_row.*);

John DeSoi, Ph.D.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo 2008-03-26 14:15:05 Re: Reindex does not finish 8.2.6
Previous Message Justin 2008-03-26 14:08:37 Re: Make MS Access "UPDATE" PostGre SQL Table