Re: [HACKERS] INSERT into VIEW

From: wieck(at)debis(dot)com (Jan Wieck)
To: phd2(at)earthling(dot)net
Cc: pgsql-hackers(at)postgreSQL(dot)org, ran(at)pirit(dot)com
Subject: Re: [HACKERS] INSERT into VIEW
Date: 1999-06-06 19:31:23
Message-ID: m10qidf-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Hello!
>
> PostgreSQL 6.4.2.
>
> ran=> create table t (some_number int4, some_string text);
> CREATE
> ran=> insert into t values(-1,'a');
> INSERT 20362 1
> ran=> insert into t values(1,'d');
> INSERT 20363 1
> ran=> create view v as select * from t where some_number>=0;
> CREATE
> ran=> insert into v values (17,'q');
> INSERT 20375 1
> ran=> select * from t;
> some_number|some_string
> -----------+-----------
> -1|a
> 1|d
> (2 rows)
>
> What is 20375? Is it real OID of dummy row?

It's the OID of the real row that got stored into relation v.

Do a

DROP RULE "_RETv";
SELECT * FROM v;

and you'll get back your (17,'q') row.

Maybe you should read now some chapters in the programmers
manual about the implementation of views, the rule system
etc.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kristofer Munn 1999-06-06 23:21:40 LO Problem List (Can we get one)
Previous Message Jan Wieck 1999-06-06 19:14:25 Re: [HACKERS] Priorities for 6.6