Re: pl/pgsql create table - Mailing list pgsql-general

From Christoph Dalitz
Subject Re: pl/pgsql create table
Date
Msg-id 20020827192832.513f388d.christoph.dalitz@hs-niederrhein.de
Whole thread Raw
In response to pl/pgsql create table  (Masse Jacques <jacques.masse@bordeaux.cemagref.fr>)
Responses Re: pl/pgsql create table  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
> Neil Conway wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > When referencing created/dropped tables in pl/pgsql, use EXECUTE to
> > > prevent the table oid from being stored in function as precompiled.  It
> > > is mentioned in the current FAQ.  The solution is for us to
> > > automatically add EXECUTE somehow.
> >
> > IMHO, no -- the solution is to automatically invalidate compiled query
> > plans when a dependant relation is removed. Not exactly sure how to do
> > it, but I was thinking of tackling this for 7.4 (suggestions are
> > welcome, of course).
>
> Yes, but how do you handle cases where the table gets create/dropped
> inside the transaction.  It is clearly tricky.
>
If I remember right, Oracle does not allow DDL-Statements in PL/SQL
procedures. You have to use a special package (I have forgotten the name)
which prevents the DDL-Statement from being precompiled.

So maybe this is a simple workaround: forbid DDL-Statements without EXECUTE.

Just my 0.2 Euros,

Christoph Dalitz


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pl/pgsql create table
Next
From: cm@coretec.at (Christian Mock)
Date:
Subject: stupid Q regarding "UPDATE waiting"