Re: [HACKERS] CREATE OR REPLACE VIEW bug

2016-12-17 Thread Tom Lane
Dean Rasheed writes: > Attached is a patch enforcing this order and adding some comments to > make it clear why the order matters here. > Barring objections I'll back-patch this to 9.4 where WCO was added. Looks reasonable in a quick once-over. I didn't test it. regards,

Re: [HACKERS] CREATE OR REPLACE VIEW bug

2016-12-17 Thread Dean Rasheed
On 17 December 2016 at 15:42, Dean Rasheed wrote: > It seems that there is a bug in CREATE OR REPLACE VIEW... > > DefineView()/DefineVirtualRelation() will need a little re-jigging to > do things in the required order. ...and the required order for existing views is 1. Add any new columns 2. Add

[HACKERS] CREATE OR REPLACE VIEW bug

2016-12-17 Thread Dean Rasheed
It seems that there is a bug in CREATE OR REPLACE VIEW's handling of WITH CHECK OPTION (noticed while thinking about the recent change to pg_dump's handling of circular dependencies in views -- d8c05af). If you use CREATE OR REPLACE VIEW on a view that isn't auto-updatable and turn it into one that

Re: [HACKERS] create or replace view

2002-11-15 Thread Stephan Szabo
On Fri, 15 Nov 2002, Zeugswetter Andreas SB SD wrote: > > > Problem is when I want change view (or functions) with a lot of dependecies > > I must drop and recreate all dependent views (or functions) - > > I want add only one column in view > > I don't know if solution hard for that. > > I do not

Re: [HACKERS] create or replace view

2002-11-15 Thread Zeugswetter Andreas SB SD
> Problem is when I want change view (or functions) with a lot of dependecies > I must drop and recreate all dependent views (or functions) - > I want add only one column in view > I don't know if solution hard for that. I do not see how adding a column to a view would invalidate dependent obje

Re: [HACKERS] create or replace view

2002-11-14 Thread Christopher Kings-Lynne
> > Well, doing create or replace as a drop/create might very well > do the same > > thing, and even if it got the same oid, we'd have to be really sure that > > nothing would misbehave upon receiving that extra column before allowing > > it for purposes of avoiding recreation of dependencies. > >

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 10:36 pm, Stephan Szabo wrote: > On Thu, 14 Nov 2002, snpe wrote: > > Problem is when I want change view (or functions) with a lot of > > dependecies I must drop and recreate all dependent views (or functions) - > > I want add only one column in view > > I don't know if

Re: [HACKERS] create or replace view

2002-11-14 Thread Christopher Kings-Lynne
> Problem is when I want change view (or functions) with a lot of > dependecies > I must drop and recreate all dependent views (or functions) - I > want add only > one column in view > I don't know if solution hard for that. This is definitely something that will cause some anguish in 7.3. I thin

Re: [HACKERS] create or replace view

2002-11-14 Thread Stephan Szabo
On Thu, 14 Nov 2002, snpe wrote: > Problem is when I want change view (or functions) with a lot of dependecies > I must drop and recreate all dependent views (or functions) - I want add only > one column in view > I don't know if solution hard for that. Well, doing create or replace as a drop/cr

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 08:01 pm, Stephan Szabo wrote: > On Thu, 14 Nov 2002, Scott Shattuck wrote: > > It might just be me but it seems that this discussion is missing the > > point if we believe this request is about saving some characters. I > > don't think it is. I think it's about being a

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 05:45 pm, Tom Lane wrote: > snpe <[EMAIL PROTECTED]> writes: > > On Thursday 14 November 2002 05:22 pm, Bruno Wolff III wrote: > >> Are you trying to save typing a few characters or what? > > > > Yes, it is 'create or replace view', not ? > > The statement was not inven

Re: [HACKERS] create or replace view

2002-11-14 Thread Stephan Szabo
On Thu, 14 Nov 2002, Scott Shattuck wrote: > It might just be me but it seems that this discussion is missing the > point if we believe this request is about saving some characters. I > don't think it is. I think it's about being able to write simple SQL > scripts that don't produce errors when yo

Re: [HACKERS] create or replace view

2002-11-14 Thread Scott Shattuck
Tom Lane wrote: snpe <[EMAIL PROTECTED]> writes: On Thursday 14 November 2002 05:22 pm, Bruno Wolff III wrote: Are you trying to save typing a few characters or what? Yes, it is 'create or replace view', not ? The statement was not invented to save a few characters of typing. It was in

Re: [HACKERS] create or replace view

2002-11-14 Thread Tom Lane
snpe <[EMAIL PROTECTED]> writes: > On Thursday 14 November 2002 05:22 pm, Bruno Wolff III wrote: >> Are you trying to save typing a few characters or what? > Yes, it is 'create or replace view', not ? The statement was not invented to save a few characters of typing. It was invented to allow peop

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 05:22 pm, Bruno Wolff III wrote: > On Thu, Nov 14, 2002 at 17:00:30 +, > > snpe <[EMAIL PROTECTED]> wrote: > > On Thursday 14 November 2002 05:01 pm, Bruno Wolff III wrote: > > > On Thu, Nov 14, 2002 at 16:49:42 +, > > > > > > snpe <[EMAIL PROTECTED]> wrote:

Re: [HACKERS] create or replace view

2002-11-14 Thread Bruno Wolff III
On Thu, Nov 14, 2002 at 17:00:30 +, snpe <[EMAIL PROTECTED]> wrote: > On Thursday 14 November 2002 05:01 pm, Bruno Wolff III wrote: > > On Thu, Nov 14, 2002 at 16:49:42 +, > > > > snpe <[EMAIL PROTECTED]> wrote: > > > I want that 'create or replace view' work drop-create if view exists

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 05:01 pm, Bruno Wolff III wrote: > On Thu, Nov 14, 2002 at 16:49:42 +, > > snpe <[EMAIL PROTECTED]> wrote: > > I want that 'create or replace view' work drop-create if view exists else > > only create > > Why do you want this? > Why 'create or replace' ? --

Re: [HACKERS] create or replace view

2002-11-14 Thread Bruno Wolff III
On Thu, Nov 14, 2002 at 16:49:42 +, snpe <[EMAIL PROTECTED]> wrote: > > I want that 'create or replace view' work drop-create if view exists else only > create Why do you want this? ---(end of broadcast)--- TIP 5: Have you checked our extens

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 04:38 pm, Rod Taylor wrote: > On Thu, 2002-11-14 at 11:17, snpe wrote: > > On Thursday 14 November 2002 02:41 pm, Bruno Wolff III wrote: > > > On Thu, Nov 14, 2002 at 13:41:18 +, > > > > > > snpe <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > When I change vi

Re: [HACKERS] create or replace view

2002-11-14 Thread Rod Taylor
On Thu, 2002-11-14 at 11:17, snpe wrote: > On Thursday 14 November 2002 02:41 pm, Bruno Wolff III wrote: > > On Thu, Nov 14, 2002 at 13:41:18 +, > > > > snpe <[EMAIL PROTECTED]> wrote: > > > Hello, > > > When I change view and change number of column PostgreSQL return error > > > : 'cannot

Re: [HACKERS] create or replace view

2002-11-14 Thread snpe
On Thursday 14 November 2002 02:41 pm, Bruno Wolff III wrote: > On Thu, Nov 14, 2002 at 13:41:18 +, > > snpe <[EMAIL PROTECTED]> wrote: > > Hello, > > When I change view and change number of column PostgreSQL return error > > : 'cannot change number of column in view' > > Is it too hard set

Re: [HACKERS] create or replace view

2002-11-14 Thread Bruno Wolff III
On Thu, Nov 14, 2002 at 13:41:18 +, snpe <[EMAIL PROTECTED]> wrote: > Hello, > When I change view and change number of column PostgreSQL return error : > 'cannot change number of column in view' > Is it too hard set this command > if view exits drop view > and then change view > > It is li

[HACKERS] create or replace view

2002-11-14 Thread snpe
Hello, When I change view and change number of column PostgreSQL return error : 'cannot change number of column in view' Is it too hard set this command if view exits drop view and then change view It is like with return type in function Now 'or replace' don't help too much regards --

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-27 Thread Jean-Michel POURE
> >CREATE OR DROP VIEW >Is this for real? If I were a database server I would say to the >client "please make up your mind" :-) I meant DROP IF EXISTS and then CREATE. This is more simple to implement than CREATE OR REPLACE. Best regards, Jean-Michel POURE ---(end of br

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-27 Thread Rene Pijlman
On Tue, 23 Oct 2001 17:16:06 +0200, you wrote: >CREATE OR DROP VIEW Is this for real? If I were a database server I would say to the client "please make up your mind" :-) Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 1: s

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-24 Thread Peter Eisentraut
Bill Studenmund writes: > > Our current CREATE OR REPLACE FUNCTION perserves the OID of the > > function. Is there similar functionality you need where a simple > > DROP (ignore the error), CREATE will not work? > > If possible, it's nice to not have commands whose error codes you ignore. > That

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-24 Thread Bill Studenmund
On Tue, 23 Oct 2001, Bruce Momjian wrote: > > If possible, it's nice to not have commands whose error codes you ignore. > > That way if you see an error, you know you need to do something about it. > > Folks, is this a valid reason for adding OR REPLACE to all CREATE object > commands? Sounds go

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-24 Thread Mike Mascari
Bruce Momjian wrote: > > > > > Alternatively, could someone implement CREATE OR DROP VIEW / TRIGGER? These > > > > features are needed for pgAdmin II (we could also provide a patch for > > > > PhpPgAdmin). If this cannot be implemented in PostgreSQL, we will go for > > > > pseudo-modification sol

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-24 Thread Bruce Momjian
> Not until we do the necessary legwork. I spent a good deal of time over > the past week making the various PL modules react to replacement of > pg_proc entries by CREATE OR REPLACE FUNCTION (cf. complaint from Peter > a week or so back). CREATE OR REPLACE VIEW implies updating cached > query p

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-24 Thread Bill Studenmund
On Tue, 23 Oct 2001, Bruce Momjian wrote: > > Dear all, > > > > Would it be possible to implement CREATE OR REPLACE VIEW / TRIGGER in > > PostgreSQL 7.2? Probably not, it's rather late in the cycle (isn't beta imminent?). Oh, I'd vote for "OR REPLACE" as there's already an opt_or_replace non-ter

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-24 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Our current CREATE OR REPLACE FUNCTION perserves the OID of the > function. Is there similar functionality you need where a simple > DROP (ignore the error), CREATE will not work? >> >> If possible, it's nice to not have commands whose error codes you

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-23 Thread Bruce Momjian
I have added this to the TODO list: * Add OR REPLACE clauses to non-FUNCTION object creation I think there are clearly some other objects that need OR REPLACE. Not sure which ones yet. --- > Dear all, > > Would

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-23 Thread Bruce Momjian
> > > Alternatively, could someone implement CREATE OR DROP VIEW / TRIGGER? These > > > features are needed for pgAdmin II (we could also provide a patch for > > > PhpPgAdmin). If this cannot be implemented in PostgreSQL, we will go for > > > pseudo-modification solutions (which is definitely not

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-23 Thread Bruce Momjian
> Dear all, > > Would it be possible to implement CREATE OR REPLACE VIEW / TRIGGER in > PostgreSQL 7.2? > > Alternatively, could someone implement CREATE OR DROP VIEW / TRIGGER? These > features are needed for pgAdmin II (we could also provide a patch for > PhpPgAdmin). If this cannot be impl

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-23 Thread Bruce Momjian
> We are also waiting for a proper ALTER table DROP column but we are day > dreamers... This is a good example of bad management on our parts. We couldn't decide between two possible DROP COLUMN implementations, so we now have the worst result, which is no implementation at all. -- Bruce Mo

Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-23 Thread Tom Lane
Jean-Michel POURE <[EMAIL PROTECTED]> writes: > Would it be possible to implement CREATE OR REPLACE VIEW / TRIGGER in > PostgreSQL 7.2? We're already vastly overdue for beta. The time for new feature requests for 7.2 is past ... especially nontrivial requests. regards,

[HACKERS] CREATE OR REPLACE VIEW/TRIGGER

2001-10-23 Thread Jean-Michel POURE
Dear all, Would it be possible to implement CREATE OR REPLACE VIEW / TRIGGER in PostgreSQL 7.2? Alternatively, could someone implement CREATE OR DROP VIEW / TRIGGER? These features are needed for pgAdmin II (we could also provide a patch for PhpPgAdmin). If this cannot be implemented in Postg