Re: getting trigger to work - Mailing list pgsql-general

From Oliver Elphick
Subject Re: getting trigger to work
Date
Msg-id 1016558064.25779.49.camel@linda
Whole thread Raw
In response to getting trigger to work  (Merrill Oveson <merrill@actarg.com>)
List pgsql-general
On Tue, 2002-03-19 at 15:46, Merrill Oveson wrote:

> The error is "Attribute 'a1000' not found"
>
> The column pros_id is char(5).
> How do I put in the  'A1000'?

                     new.pros_id:= ''A1000'';

Your first example used a number, which was automatically converted to a
char for comparison.

The second was interpreted as an identifier and lower-cased, but you had
no attribute in the table called "a1000".  You need to put it in single
quotes to have it treated as a char constant; since you are inside a
plpgsql program declaration, the quotes need to be doubled up.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     " And God shall wipe away all tears from their eyes;
      and there shall be no more death, neither sorrow, nor
      crying, neither shall there be any more pain: for the
      former things are passed away."
                          Revelations 21:4


pgsql-general by date:

Previous
From: Eric Lee Green
Date:
Subject: Re: Performance issues
Next
From: Jori Luoto
Date:
Subject: Performance question