From: | Bob Pawley <rjpawley(at)shaw(dot)ca> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Michael Fuhr <mike(at)fuhr(dot)org>, Postgresql <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Inserting Data |
Date: | 2006-08-23 23:21:00 |
Message-ID: | 00a601c6c70a$cf9e8270$8e904618@owner |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
What I have is one table which stores device_id numbers that are referenced
on the second table "library.devices".
I need to insert device_ids from the first table that satisfy the conditions
of the argument found on the library table. Hence the 'where' clause.
So far all I can get are errors when I attempt this procedure.
Hence - my problem.
Bob
----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
Cc: "Michael Fuhr" <mike(at)fuhr(dot)org>; "Postgresql"
<pgsql-general(at)postgresql(dot)org>
Sent: Wednesday, August 23, 2006 4:05 PM
Subject: Re: [GENERAL] Inserting Data
> Bob Pawley <rjpawley(at)shaw(dot)ca> writes:
>> insert into p_id.loops (monitor) values (new.devices_id)
>> where new.device_number = library.devices.device_number
>> and library.devices.type_ = 'mon' ;
>
> Huh? How did library.devices get into this? Are you trying to join to
> it, and if so why, seeing that the value you want to insert into
> p_id.loops is independent of that table?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-08-23 23:42:32 | Re: CASCADING could not open relation with OID |
Previous Message | Silvela, Jaime (Exchange) | 2006-08-23 23:15:52 | Re: CASCADING could not open relation with OID |