Skip site navigation (1) Skip section navigation (2)

Re: [BUG] PostgreSQL 7.0.3 backend dumps core.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alan Turner <alan(at)suburbia(dot)com(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [BUG] PostgreSQL 7.0.3 backend dumps core.
Date: 2000-11-28 15:22:52
Message-ID: 15000.975424972@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Alan Turner <alan(at)suburbia(dot)com(dot)au> writes:
> test=# CREATE FUNCTION "f2" ( ) RETURNS magic AS '
> test'#         DECLARE
> test'#                 x RECORD;
> test'#         BEGIN
> test'#                 x.one := 1;
> test'#                 x.two := 2;
> test'#                 RETURN x;
> test'#         END;
> test'# ' LANGUAGE 'plpgsql';
> CREATE
> test=# select f2();
> pqReadData() -- backend closed the channel unexpectedly.

I think this coding should be rejected, but evidently it's not.  My
understanding of "record" in plpgsql is that it's just a placeholder
name for a tuple type determined elsewhere.  In this situation the
exact type of x is never determined, and so you shouldn't be able to
assign to fields of x.  Ooops.

In the meantime, it might work if you declare "x magic" instead of
"x record".

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-11-28 15:42:49
Subject: Re: PortalHeapMemoryFree...in diskless client
Previous:From: Karla PeraltaDate: 2000-11-28 11:24:49
Subject: Re: PortalHeapMemoryFree...in diskless client

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group