From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Subject: | create or replace rule/view (fwd) |
Date: | 2002-08-14 01:05:06 |
Message-ID: | Pine.LNX.4.21.0208141104160.31602-101000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Re-sent.
No one else seems to have received it.
Bruce: copied you in to make sure.
Gavin
---------- Forwarded message ----------
Date: Mon, 12 Aug 2002 03:22:08 +1000 (EST)
From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-patches(at)postgresql(dot)org
Subject: create or replace rule/view
Attached is a patch implementing:
create or replace rule ...
create or replace view ...
It passes all regression tests. There's only one really sketchy part of
the patch: UpdateAttributeTuples(). This routine is fairly dangerous since
it simply removes a given relid's pg_attribute entries and creates a new
set basic on a given TupleDesc. Naturally, it is only useful for views.
It is important to have this functionality so that you can do something
like:
template1=# create view abc as select 'test'::text as a;
CREATE VIEW
template1=# select * from abc;
a
------
test
(1 row)
template1=# create or replace view abc as select '1'::int2 as a;
CREATE VIEW
template1=# select * from abc;
a
---
1
(1 row)
Regardless, the patch may need some cleaning up. Unfortunately, I don't
have enough time on my hands over the coming week. Considering beta is
coming up I thought it best to submit and see what happens.
Gavin
Attachment | Content-Type | Size |
---|---|---|
crv.diff.gz | application/x-gzip | 5.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Neil Conway | 2002-08-14 02:29:05 | updated lock listing patch |
Previous Message | Ulrich Neumann | 2002-08-13 17:42:48 | Re: Antw: Re: Patch for NetWare support |