Vinod Kurup (vkurup(at)massmed(dot)org) reports a bug with a severity of 3
The lower the number the more severe it is.
coalesce in execute crashes backend
When I use a coalesce statement to calculate an expression that is part of a dynamic query, it crashes the backend. Interestingly, it works if I use constants as arguments to coalesce.
create function vk_test()
returns integer as '
v_id := 2;
raise notice ''try a constant.'';
execute ''select '' || coalesce(2,0) || '';'';
raise notice ''that worked'';
raise notice ''now, try a var with the same value.'';
execute ''select '' || coalesce(v_id,0) || '';'';
raise notice ''we never get here'';
end;' language 'plpgsql';
PostgreSQL 7.1 on i586-pc-linux-gnu, compiled by GCC 2.95.3
psql:junk.sql:24: NOTICE: try a constant.
psql:junk.sql:24: NOTICE: that worked
psql:junk.sql:24: NOTICE: now, try a var with the same value.
psql:junk.sql:24: pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
psql:junk.sql:24: connection to server was lost
NOTICE: try a constant.
NOTICE: that worked
NOTICE: now, try a var with the same value.
Server process (pid 7516) exited with status 11 at Tue Jun 12 14:32:13 2001
Terminating any active server processes...
NOTICE: Message from PostgreSQL backend:
The Postmaster has informed me that some other backend died abnormally and possibly corrupted shared memory.
I have rolled back the current transaction and am going to terminate your database system connection and exit.
Please reconnect to the database system and repeat your query.
No file was uploaded with this report
pgsql-bugs by date
|Next:||From: Arcady Genkin||Date: 2001-06-12 20:13:17|
|Subject: Re: REPOST: redefining location of the socket file /tmp/.s.PGSQL.5432|
|Previous:||From: Cary O'Brien||Date: 2001-06-12 14:28:11|
|Subject: Index files grow forever?|