Skip site navigation (1) Skip section navigation (2)

Insert into view

From: Theo Kramer <theo(at)flame(dot)co(dot)za>
To: hackers(at)postgresql(dot)org
Subject: Insert into view
Date: 1999-11-30 10:25:22
Message-ID: 3843A612.FBAE3F1C@flame.co.za (view raw or flat)
Thread:
Lists: pgsql-hackers
Any thoughts on the following

------------------------------ testview.sql
-------------------------------------
drop table testhead; /* If it exists */
drop table testline; /* If it exists */
drop view testview; /* If it exists */

create table testhead (
  part text
);

create table testline (
  part text,
  colour text,
  adate datetime default 'now'
);

create view testview as
  select testhead.part, testline.colour, testline.adate from testhead, testline
  where testhead.part = testline.part;

insert into testview values  ('pen', 'green');
insert into testview values  ('pen', 'blue');
insert into testview values  ('pen', 'black');

select * from testview;

-----------------------------------------------------------------------------------

The inserts report no errors, and when looking into $PGDATA/base/mydb/testview
with a hex editor I can see the values inserted. 

The select on view returns nothing... 

Should the insert not fail seeing that views are read only ?

-- 
--------
Regards
Theo

pgsql-hackers by date

Next:From: Oleg BartunovDate: 1999-11-30 10:31:22
Subject: Re: [HACKERS] union and LIMIT problem
Previous:From: Hannu KrosingDate: 1999-11-30 08:42:25
Subject: Re: [HACKERS] sort on huge table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group