Re: What do I do with this error?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: What do I do with this error?
Date: 2001-03-19 04:22:21
Message-ID: 8897.984975741@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Josh Berkus" <josh(at)agliodbs(dot)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 functions
Result | 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Karel Zak 2001-03-19 09:06:54 Re: hierarchical order equivalent
Previous Message Stephan Szabo 2001-03-19 04:21:30 Re: What do I do with this error?