Re: Inserting Data

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-24 00:34:27
Message-ID: 00cd01c6c715$12e13eb0$8e904618@owner
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm not arguing (I'm attempting to learn) - but this seems to be counter
intuitive when writing a procedure.

I know that it exists because, through the interface, I have selected it
from the same library table.

Could you explain why Postgresql simply doesn't accept the simple 'where'
statement that was in my earlier e-mail.

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:44 PM
Subject: Re: [GENERAL] Inserting Data

> Bob Pawley <rjpawley(at)shaw(dot)ca> writes:
>> 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.
>
> This isn't real clear to me, but perhaps you are looking for something
> like
>
> IF EXISTS(select 1 from library.devices where ...) THEN
> INSERT INTO ... values(new.device_id);
> END IF;
>
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-08-24 01:41:07 Re: [GENERAL] pgxml & xpath_table
Previous Message Jeff Davis 2006-08-24 00:14:18 Re: XPath and XML support