Re: [BUGS] postgresql-6.1.1: insert into XXX select * from YYY does not working where YYY are view.

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: ic(at)cms(dot)spb(dot)su (Ivan Crivoruchko)
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: [BUGS] postgresql-6.1.1: insert into XXX select * from YYY does not working where YYY are view.
Date: 1998-01-11 21:33:51
Message-ID: 199801112133.QAA12711@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fixed in 6.3. Beta is Feb 1.

> sql query "insert into XXX select * from YYY" does not working if
> YYY are view.
>
>
>
> Please describe a way to repeat the problem. Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
>
> [ic(at)cms ic]$ createdb bugexample
> [ic(at)cms ic]$ psql bugexample
> Welcome to the POSTGRESQL interactive sql monitor:
> Please read the file COPYRIGHT for copyright terms of POSTGRESQL
>
> type \? for help on slash commands
> type \q to quit
> type \g or terminate with semicolon to execute query
> You are currently connected to the database: bugexample
>
> bugexample=> create table foo ( x int );
> CREATE
> bugexample=> insert into foo values (1);
> INSERT 3035758
> bugexample=> insert into foo values (2);
> INSERT 3035759
> bugexample=> select * from foo;
> x
> -
> 1
> 2
> (2 rows)
>
> bugexample=> create view bar as select * from foo;
> CREATE
> bugexample=> select * from bar;
> x
> -
> 1
> 2
> (2 rows)
>
> bugexample=> create table foobar ( x int );
> CREATE
> bugexample=> insert into foobar select * from bar;
> INSERT 0
> bugexample=> select * from foobar;
> x
> -
> (0 rows)
>
> bugexample=>
>
>
>
> NOTE: This bug also hapenes if we runing
> "insert into XXX (F1,F2...) select F1,F2... from YYY",
> or if we select from multiple tables and one or more tables
> are views, independant of "where ...." expression.
>
>
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
> ?
>
>
>
> ic
>
> P.S. Sorry for my bad english grammatic ... :-(
>
>

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-11 21:34:44 Re: [BUGS] postgresql-6.1.1: losing "distinct" in "create view XXX as select distinct ...".
Previous Message Bruce Momjian 1998-01-11 20:53:54 Re: [PATCHES] Patches for getting version 6.2/6.2.1 running on