Re: plpgsql Difference in behaviour between versions?

Поиск
Список
Период
Сортировка
От Jerry Sievers
Тема Re: plpgsql Difference in behaviour between versions?
Дата
Msg-id 87fwhe7bx9.fsf@comcast.net
обсуждение исходный текст
Ответ на plpgsql Difference in behaviour between versions?  (Chris McDonald <chrisjonmcdonald@gmail.com>)
Ответы Re: plpgsql Difference in behaviour between versions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Chris McDonald <chrisjonmcdonald@gmail.com> writes:

> Hi, I am upgrading a system from postgresql 8.4.8 (fedora 13 x64) to
> postgresql 9.0.5 (fedora 15 x64). As I build a database I've noticed
> that the following works on 8.4.8 but does not work on 9.0.5. Can
> someone tell me why this is not legal syntax in 9.0.5 but is legal
> in 8.4.8 please:
>
> ===snip===
> create type mytype
> as
> (
>    somekey integer,
>    open numeric(14, 2)
> );
>
> CREATE OR REPLACE FUNCTION myfunc(IN INTEGER, IN NUMERIC(14, 2))
>     RETURNS VOID
> AS $$
> DECLARE
>     somekey ALIAS FOR $1;
>     rec mytype;
> BEGIN
>     rec.somekey = somekey;
>
>         -- 9.0.5 will fail at the dot character in the
>         -- following line here with syntax error sqlstate 42601
>         -- but 8.4.8 is happy.
>     rec."open" = 32;

Hmmm, I do not see that open is a reserved word but the PL must be
treating it special somehow.

See where I've added quotes above which gets it working on my 9.1
instance.

HTH

>         -- ^
>
>     RETURN;
> END;
> $$ LANGUAGE plpgsql;
> ===snip===
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 305.321.1144

В списке pgsql-general по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql Difference in behaviour between versions?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Compiler does not detect support for 64 bit integers