Re: Error when selecting rows from a temporary table in ODBC

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Ligia Pimentel <lmpimentel(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Error when selecting rows from a temporary table in ODBC
Date: 2001-03-22 01:42:00
Message-ID: 3AB95868.AD204C08@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-03-22 02:55:36 Re: Re: [SQL] I cannot vacuum
Previous Message Stephan Szabo 2001-03-22 01:21:25 Re: CHAR or VARCHAR