From: | "Aasmund Midttun Godal" <postgresql(at)aasmund(dot)com> |
---|---|
To: | miki(at)canaan(dot)co(dot)il |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: insert into view |
Date: | 2002-10-06 17:47:51 |
Message-ID: | 20021006174751.3687.qmail@aux.krot.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
currval('a_field11_seq')
Regards,
A.
On Sun, 6 Oct 2002 19:42:56 +0200, "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il> wrote:
> Hi
>
> im trying to insert into the following view and i have problem handeling the
> serial type
>
> CREATE TABLE a (field11 serial PRIMARY KEY,field12 integer);
> CREATE TABLE b (field11 integer REFERENCES field11, field22 integer PRIMARY
> KEY)
>
> CREATE VIEW some_view AS
> SELECT * FROM a,b left join b using (field11);
>
> CREATE RULE insert_into_view AS ON INSERT TO some_view DO INSTEAD (
> INSERT INTO a (field12) VALUES (NEW.field11);
> INSERT INTO b (field11, field22) VALUES (NEW.field11, NEW.field22);
> );
>
> now.
>
> how do i tell him the second insert in the rule to use the new value of the
> serial from the first insert ?
>
> Thanks in advance
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
Aasmund Midttun Godal
aasmund(at)godal(dot)com - http://www.godal.com/
+47 40 45 20 46
From | Date | Subject | |
---|---|---|---|
Next Message | Ravi | 2002-10-06 21:18:36 | psql: relocation error: psql: undefined symbol: PQgetssl |
Previous Message | Ben-Nes Michael | 2002-10-06 17:42:56 | insert into view |