Re: inner join problem with temporary tables

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: PFC <lists(at)peufeu(dot)com>
Cc: guillermoariast(at)linuxwaves(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: inner join problem with temporary tables
Date: 2007-06-13 22:57:41
Message-ID: 20070613225741.GB30189@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PFC wrote:
>
> >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 is correct but it's not the problem at hand -- notice how the
error message is not talking about an unknown OID. I think the problem
here is that he is using SELECT INTO, which is different in PL/pgSQL
than what is in plain SQL. I bet using CREATE TABLE AS instead of
SELECT INTO would work.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pascal Hakim 2007-06-14 02:02:02 Re: [GENERAL] psql : Error: Cannot stat /pgdata/8.2/main
Previous Message Alejandro Torras 2007-06-13 22:39:42 Re: Using the GPU