With latest CVS, rules regress test is failing with

  -- Test for constraint updates/deletes
  --
  insert into rtest_system values ('orion', 'Linux Jan Wieck');
+ ERROR:  You can't change view relation rtest_system
  insert into rtest_system values ('notjw', 'WinNT Jan Wieck (notebook)');
+ ERROR:  You can't change view relation rtest_system
  insert into rtest_system values ('neptun', 'Fileserver');
+ ERROR:  You can't change view relation rtest_system
  insert into rtest_interface values ('orion', 'eth0');
  insert into rtest_interface values ('orion', 'eth1');
  insert into rtest_interface values ('notjw', 'eth0');
  insert into rtest_interface values ('neptun', 'eth0');
  insert into rtest_person values ('jw', 'Jan Wieck');
+ ERROR:  You can't change view relation rtest_person
  insert into rtest_person values ('bm', 'Bruce Momjian');
+ ERROR:  You can't change view relation rtest_person
  insert into rtest_admin values ('jw', 'orion');
  insert into rtest_admin values ('jw', 'notjw');
  insert into rtest_admin values ('bm', 'neptun');
  update rtest_system set sysname = 'pluto' where sysname = 'neptun';
+ NOTICE:  mdopen: couldn't open rtest_system: No such file or directory
+ ERROR:  cannot open relation rtest_system
  select * from rtest_interface;
   sysname | ifname 

and it goes downhill from there...

			regards, tom lane

Tue, 12 Sep 2000 16:14:00 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Doesn't anyone around here run the regression tests on patches?
Hello,
Why is there cmax in tuple ? cxxx is used to determine
if tuple was inserted/deleted by current command or
past command. Because one command can't both insert
and delete the same tuple, only something like "cupd"
might be needed and flag which tells you whether cupd
is time of insert or delete. This saves 4byte from 
header .. 

devik


Wed, 25 Oct 2000 10:28:36 +0200
devik@cdi.cz
Unneccessary cmax in heap tuple ?


devik@cdi.cz wrote:

> Hello,
> Why is there cmax in tuple ? cxxx is used to determine
> if tuple was inserted/deleted by current command or
> past command. Because one command can't both insert
> and delete the same tuple, only something like "cupd"
> might be needed and flag which tells you whether cupd
> is time of insert or delete. This saves 4byte from
> header ..
>

If a tuple was inserted and updated in current transaction,
how could we judge if the tuple was valid for a given
ScanCommandId  ?
However there could be other improvements.

Regards.
Hiroshi Inoue


Wed, 25 Oct 2000 18:49:05 +0900
Hiroshi Inoue <Inoue@tpf.co.jp>
Re: Unneccessary cmax in heap tuple ?


devik@cdi.cz wrote:

> > > Why is there cmax in tuple ? cxxx is used to determine
> > > if tuple was inserted/deleted by current command or
> > > past command. Because one command can't both insert
> > > and delete the same tuple, only something like "cupd"
> > > might be needed and flag which tells you whether cupd
> > > is time of insert or delete. This saves 4byte from
> > > header ..
> >
> > If a tuple was inserted and updated in current transaction,
> > how could we judge if the tuple was valid for a given
> > ScanCommandId  ?
> > However there could be other improvements.
>
> Ahh I did not know that there is need to test tuple for
> validity for some past cid. I thought that we only need
> to know whether tuple has been updated by current cid
> to ensure that it will not be scanned again in the same
> cid... Where am I wrong ?

For example,INSENSITIVE cursors(though not implemented) ?
INSENSITIVE cursors see changes made by neither other
backends nor the backend itself.

Regards.
Hiroshi Inoue


Wed, 25 Oct 2000 19:32:52 +0900
Hiroshi Inoue <Inoue@tpf.co.jp>
Re: Unneccessary cmax in heap tuple ?
> > Why is there cmax in tuple ? cxxx is used to determine
> > if tuple was inserted/deleted by current command or
> > past command. Because one command can't both insert
> > and delete the same tuple, only something like "cupd"
> > might be needed and flag which tells you whether cupd
> > is time of insert or delete. This saves 4byte from
> > header ..
> 
> If a tuple was inserted and updated in current transaction,
> how could we judge if the tuple was valid for a given
> ScanCommandId  ?
> However there could be other improvements.

Ahh I did not know that there is need to test tuple for
validity for some past cid. I thought that we only need
to know whether tuple has been updated by current cid
to ensure that it will not be scanned again in the same
cid... Where am I wrong ?
devik



Wed, 25 Oct 2000 14:06:12 +0200
devik@cdi.cz
Re: Unneccessary cmax in heap tuple ?
devik@cdi.cz writes:
> Ahh I did not know that there is need to test tuple for
> validity for some past cid. I thought that we only need
> to know whether tuple has been updated by current cid
> to ensure that it will not be scanned again in the same
> cid... Where am I wrong ?

In situations like SQL function calls, it may be necessary to suspend
a table scan while we go off and do other commands, then come back and
resume the table scan.  So there can be multiple scans with different
command IDs in progress within a transaction.

			regards, tom lane

Wed, 25 Oct 2000 14:04:38 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Unneccessary cmax in heap tuple ? 
Tom Lane wrote:
> In situations like SQL function calls, it may be necessary to suspend
> a table scan while we go off and do other commands, then come back and
> resume the table scan.  So there can be multiple scans with different
> command IDs in progress within a transaction.

Ohh yes .. you are right. Thanks for explanation.
devik


Thu, 26 Oct 2000 12:48:33 +0200
devik@cdi.cz
Re: Unneccessary cmax in heap tuple ?