Re: inner join problem with temporary tables

From: PFC <lists(at)peufeu(dot)com>
To: guillermoariast(at)linuxwaves(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: inner join problem with temporary tables
Date: 2007-06-13 22:28:39
Message-ID: op.ttvsp1ircigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> This message appears:
>
> ERROR: relation "t_arti" does not exist
> SQL state: 42P01
> Context: SQL function "test1"
>
>
> Why it does not work???
> thanks for your help

Because plpgsql functions are compiled on first execution and all queries
are then prepared. All tables are referenced directly in prepared
statements, not by name. Any prepared statement that refers to dropped
tables (even dropped temp tables) is thus unfit for consumption.

This allows queries in plpgsql functions to be extremely fast, but it
isn't smart enough (yet) to recompile functions when a table the function
depends on is dropped.

Just disconnect and reconnect, all prepared plans will be lost, and it
will work. Or issue your queries directly instead of using a function.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-06-13 22:29:40 Re: pointer to feature comparisons, please
Previous Message PFC 2007-06-13 22:23:44 Re: pointer to feature comparisons, please