Re: What do I do with this error?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What do I do with this error?
Дата
Msg-id 8897.984975741@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: What do I do with this error?  ("Josh Berkus" <josh@agliodbs.com>)
Ответы Re: What do I do with this error?  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-sql
"Josh Berkus" <josh@agliodbs.com> writes:
> Er, Tom, I'm using 7.1.
> Pgsql does return a null as expected when going from the command line.
> However, if I call the regular expression from within a PL/pgSQL
> function, it bombs.

Well, that's more interesting, but I still can't reproduce it ...

regression=# \df+ test1
                               List of functionsResult  | Function | Arguments |  Owner   | Language |
                                      Source                                                                  |
Description

---------+----------+-----------+----------+----------+-------------------------
--------------------------------------------------------------------------------
-------------------------------------------------------------------+------------
-integer | test1    |           | postgres | plpgsql  | declare
expression1 VARCHAR;
return_value INT4;
BEGIN
expression1 := NULL;
SELECT id INTO return_value
FROM table1
WHERE field2 ~* expression1;
RETURN return_value;
END;|
(1 row)

regression=# create table table1 (id int, field2 text);
CREATE
regression=# select test1();test1
-------

(1 row)

regression=# insert into table1 values(1,'zz');
INSERT 1273361 1
regression=# select test1();test1
-------

(1 row)

regression=# insert into table1 values(1,null);
INSERT 1273362 1
regression=# select test1();test1
-------

(1 row)


        regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: What do I do with this error?
Следующее
От: Karel Zak
Дата:
Сообщение: Re: hierarchical order equivalent