RE: [HACKERS] SPI_prepare() doesn't work well ?

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Jan Wieck" <jwieck(at)debis(dot)com>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] SPI_prepare() doesn't work well ?
Date: 1999-01-21 00:13:53
Message-ID: 000201be44d2$eda09e60$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> -----Original Message-----
> From: owner-pgsql-hackers(at)postgreSQL(dot)org
> [mailto:owner-pgsql-hackers(at)postgreSQL(dot)org]On Behalf Of Jan Wieck
> Sent: Thursday, January 21, 1999 12:57 AM
> To: Hiroshi Inoue
> Cc: pgsql-hackers(at)postgreSQL(dot)org; mcontzen(at)dohle(dot)com
> Subject: Re: [HACKERS] SPI_prepare() doesn't work well ?
>
>
> Hiroshi Inoue wrote:
>
> >
> > Hello all,
> >
> > It seems that SPI_prepare() doesn't work well in some cases.
> >
> > Pawel Pierscionek [pawel(at)astercity(dot)net] reported about the
> > following case 1([SQL] drop table in pgsql).
> > Michael Contzen [mcontzen(at)dohle(dot)com] reported about the
> > following case 2(PL/PGSQL bug using aggregates).
> > You can find it from pgsql-hackers archive.
> >

[snip]

> >
> > 2. Aggregates in PL/pgSQL cause wrong results.
> >
> > Is it proper to use set_agg_tlist_references() function to
> > reconstruct aggs member node for Agg type nodes ?
>
> Don't know. It is important, that the copy of the tree has
> absolutely NO references to anything outside itself. The
> parser/rewrite/planner combo creates all plans in the actual
> transactions memory context. So they will get destroyed at
> transaction end.
>

In my patch set_agg_tlist_refereces() function is appiled for
copied(new) Agg type nodes,not for original(old) nodes.

This case is a special case of

How does copyObject() copy multiply referenced objects ?

As to this case,PostgreSQL Executor sets aggno's of Aggreg Nodes
using aggs member node of Agg type nodes.
As a result,aggno's of the Aggreg nodes contained in TargetList
are set because they have common pointers.
So multiply referenced Aggreg type nodes must be copied to new
plan as multiply referenced nodes.

Thanks.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-01-21 02:10:43 Re: [HACKERS] Re: Beta test of Postgresql 6.5
Previous Message Bruce Momjian 1999-01-20 19:49:55 Re: [HACKERS] Re: Beta test of Postgresql 6.5