pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: zoulx1982@163.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7658: the result of pg_get_viewdef can NOT execute directly
Date: Wed, 14 Nov 2012 07:26:08 +0000
Message-ID: <E1TYXMO-00036L-6u@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      7658
Logged by:          ZouLixian
Email address:      zoulx1982@163.com
PostgreSQL version: 9.2.0
Operating system:   Linux
Description:        

postgres=# 
postgres=# select version();
                                                      version               
                               
       
------------------------------------------------------------------------------------------------------------
-------
 PostgreSQL 9.2.0 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2
20080704 (Asianux 3.0 4.1.2-44), 
64-bit
(1 row)

postgres=# 
postgres=# create table t1(a int, b int);
CREATE TABLE
postgres=# create table t2(c int, d int);
CREATE TABLE
postgres=# create view v as select * from t1 t where a in (select a from t2
t);
CREATE VIEW
postgres=# select pg_get_viewdef('v');
                          pg_get_viewdef                          
------------------------------------------------------------------
 SELECT t.a, t.b FROM t1 t WHERE (t.a IN (SELECT t.a FROM t2 t));
(1 row)

postgres=# SELECT t.a, t.b FROM t1 t WHERE (t.a IN (SELECT t.a FROM t2 t));
ERROR:  column t.a does not exist
LINE 1: SELECT t.a, t.b FROM t1 t WHERE (t.a IN (SELECT t.a FROM t2 ...
                                                        ^
postgres=# 
postgres=#





view thread (2+ messages)  latest in thread

Message-ID: <E1TYXMO-00036L-6u@wrigleys.postgresql.org>
Permalink:  ../E1TYXMO-00036L-6u@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1TYXMO-00036L-6u@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: zoulx1982@163.com
  Subject: Re: BUG #7658: the result of pg_get_viewdef can NOT execute directly
  In-Reply-To: <E1TYXMO-00036L-6u@wrigleys.postgresql.org>
  References: <E1TYXMO-00036L-6u@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox