Re: Error when selecting rows from a temporary table in ODBC - Mailing list pgsql-sql

From Hiroshi Inoue
Subject Re: Error when selecting rows from a temporary table in ODBC
Date
Msg-id 3AB95868.AD204C08@tpf.co.jp
Whole thread Raw
In response to Error when selecting rows from a temporary table in ODBC  ("Ligia Pimentel" <lmpimentel@yahoo.com>)
Responses Re: Error when selecting rows from a temporary table in ODBC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Ligia Pimentel wrote:
> 
> When we execute this query in psql over linux, we don't get any errors
> 
> select sum(valor) as totalCR, count(correlativo) as docsCR, caja into tmp_cr
> from transaccion as t, codigocaja as c
> where c.codigo = t. codigo
> and c.tipomov = 'CR'
> group by caja;
> 
> select sum(valor) as totalDB, count(correlativo) as docsDB, caja into tmp_db
> from transaccion t, codigocaja c
> where c.codigo = t. codigo
> and c.tipomov = 'DB'
> group by caja;
> 
> select db.caja, totalcr, totaldb, docsdb, docscr
> from tmp_db db, tmp_cr cr
> where cr.caja  = db.caja;
> 
> But when we execute it on PGAdmin (Windows via ODBC) we get the following
> error message: ERROR from backend during clear: 'ERROR:  relation_info:
> Relation 2300301 not found
> 
> Following is the message in psqlodbc.log,
> 
> conn=57295424, query='drop table tmp_cr; drop table tmp_db; select
> sum(valor) as totalCR, count(correlativo) as docsCR, caja into tmp_cr from
> transaccion as t, codigocaja as c where c.codigo = t. codigo and c.tipomov =
> 'CR' group by caja; select sum(valor) as totalDB, count(correlativo) as
> docsDB, caja into tmp_db from transaccion t, codigocaja c where c.codigo =
> t. codigo and c.tipomov = 'DB' group by caja; select db.caja, totalcr,
> totaldb, docsdb, docscr from tmp_db db, tmp_cr cr where cr.caja = db.caja; '

Seems a chained query is issued.
Queries in a chained query are parse and analyzed all
together before the chained query's execution. Therefore
SELECT couldn't see tables which didn't exist before
the execution.

regards,
Hiroshi Inoue


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: CHAR or VARCHAR
Next
From: Tom Lane
Date:
Subject: Re: [ADMIN] Re: I cannot vacuum