Kuti Attila wrote:
> Hi,
>
> I have a pgplsql function. It is quite short and simple.
>
> The problem:
>
> The following error message comes up for the SECOND time I call the it
> "Relation 44451 does not exist"
>
> In the function I create a temporary table, and at the end I drop it. There
> may be problem with this ? I don't know.
Plpgsql is compiled, so it refers to tables via their OID. The second
time around Tmembers has a different OID and so you get your error message.
The solution is to use the EXECUTE construct when accessing the table,
or to use an interpreted language (e.g. pltcl).
HTH
--
Richard Huxton
Archonet Ltd