From: | Bob Pawley <rjpawley(at)shaw(dot)ca> |
---|---|
To: | Alban Hertroys <alban(at)magproductions(dot)nl> |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Is it databases in general, SQL or Postgresql? |
Date: | 2005-11-15 17:53:29 |
Message-ID: | 009f01c5ea0d$7dad21e0$ac1d4318@OWNER |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
No - I mean when each row of pr (contain) has 'ip' inserted as a value or
data.
Bob
----- Original Message -----
From: "Alban Hertroys" <alban(at)magproductions(dot)nl>
To: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
Cc: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, November 15, 2005 9:42 AM
Subject: Re: [GENERAL] Is it databases in general, SQL or Postgresql?
> Bob Pawley wrote:
>> Sample 2 below, does not work. From a logical (perhaps naive) extension
>> of Sample 1, I adapted the function to identify which of the serial
>> numbers in table pr is to be transferred to table pi. I am attempting to
>> do this as part of the database structure _not_ as data retrieval.
>> Could someone explain to me why this isn't acceptable as a simple basic
>> function?
>> Could someone explain to me what needs to be changed, enhanced or
>> modified to make this database structure work?
>
>> Sample 2
>> create or replace function base() returns trigger as $$
>>
>> begin
>>
>> insert into pi (fluid_id) values (new.fluid_id)
>>
>> where pr (contain) = 'ip';
>
> I suppose you mean "where pr.contain = 'ip'" instead? pr is a table, not a
> function.
>
> You'd be in some interesting trouble if there'd be a function pr(text)
> returning text - it would evaluate the function with the content of your
> column and compare the result to your string.
>
>> ERROR: syntax error at or near "where" at character 41
>>
>> QUERY: insert into pi (fluid_id) values ( $1 ) where pr (contain) = 'ip'
>>
>> CONTEXT: PL/pgSQL function "base" line 2 at SQL statement
>
>
> --
> Alban Hertroys
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2005-11-15 17:55:02 | Re: Is it databases in general, SQL or Postgresql? |
Previous Message | Bruce Momjian | 2005-11-15 17:43:11 | Re: Number of items in a cursor... |