Re: prepare-alter-exec issue

From: Dhanaraj <Dhanaraj(dot)M(at)Sun(dot)COM>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: prepare-alter-exec issue
Date: 2006-03-03 11:51:52
Message-ID: 44082DD8.6050101@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The same bug was filed already in the end of Nov.

There are two ways to fix this.

1) After altering the table, prepare buffer should be cleared
or
2) The prepare stmt should be updated whenever alter query is executed.

I hope that this bug will be fixed in the next version..

Regards
Dhanaraj
Qingqing Zhou wrote:
> I encounter a server(8.1.1) problem like this:
>
> create table tt(id int);
> prepare p1(int) as insert into tt values($1);
> execute p1(3);
> alter table tt alter id type char(10);
> execute p1(9999999);
> select * from tt;
> ^ server core dumps here
>
> Command "execute p1(9999999)" works because the prepared plan still treat
> 9999999 as an integer, but "select * from tt" causes core dump because it
> treats the attribute as type varlena char - so 9999999 becomes the varlen.
>
> This might be a known issue, but seems not mentioned in the document:
> http://www.postgresql.org/docs/current/static/sql-prepare.html
>
>
> Regards,
> Qingqing
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gavin Scott 2006-03-03 18:18:07 BUG #2299: pg_dump error w/ renamed primary keys
Previous Message Qingqing Zhou 2006-03-03 06:45:52 Re: BUG #2296: select query error.