"Foster, Stephen" <[EMAIL PROTECTED]> writes:
> Michael, I tried that line in the trigger procedure with double quotes,
> single quotes and without.  The only way it would save was with single
> quotes and that is why you saw it that way.

Just for reference, the thing that was tripping you up (or one thing
that was tripping you up at least) was trying to extrapolate the syntax

        typename 'literal value'

to situations where you didn't mean an actual literal constant.  This
syntax is something that's forced on us by the SQL standard, but we do
not support it for anything but literal constants (which is all that the
standard defines it for, either).  In the examples you gave, you wanted
to coerce the value of a variable of one type to some other type, and so
you should have written either

        CAST( variablename AS typename )
or
        variablename :: typename

the former being the SQL-spec syntax for a runtime type conversion
and the latter being a traditional Postgres abbreviation.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to