Re: [HACKERS] pg_views.definition

2002-07-17 Thread Jan Wieck
Joe Conway wrote: The problem is that you would still need to keep a copy of your view around to recreate it if you wanted to drop and recreate a table it depends on. I really like the idea about keeping the original view source handy in the system catalogs. This has been the case all the

Re: [HACKERS] pg_views.definition

2002-07-17 Thread Hannu Krosing
On Wed, 2002-07-17 at 09:56, Jan Wieck wrote: Joe Conway wrote: The problem is that you would still need to keep a copy of your view around to recreate it if you wanted to drop and recreate a table it depends on. I really like the idea about keeping the original view source handy in the

Re: [HACKERS] pg_views.definition

2002-07-17 Thread Hannu Krosing
On Wed, 2002-07-17 at 09:56, Jan Wieck wrote: Joe Conway wrote: The problem is that you would still need to keep a copy of your view around to recreate it if you wanted to drop and recreate a table it depends on. I really like the idea about keeping the original view source handy in the

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Christopher Kings-Lynne
We actually reverse it on the fly: test= \d xx View xx Column | Type | Modifiers -+--+--- relname | name | View definition: SELECT pg_class.relname FROM pg_class; Well, no - that's just dumping out the parsed form. eg.

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes: It's really annoying when people save their view definition in phpPgAdmin and when they load it up again it's lost all formatting. Functions and rules, for instance keep the original formatting somewhere. Rules do not. (A view is just a rule

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Jan Wieck
Bruce Momjian wrote: Christopher Kings-Lynne wrote: Hi, Would it be possible to add a new attribute to pg_views that stores the original view definition, as entered via SQL? This would make the lives of those of us who make admin interfaces a lot easier... We actually reverse

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Tom Lane
Jan Wieck [EMAIL PROTECTED] writes: We actually reverse it on the fly: We do, but as soon as you break the view by dropping an underlying object it fails to reconstruct. So having the original view definition at hand could be useful for some ALTER VIEW RECOMPILE command. Note that the

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Jan Wieck
Tom Lane wrote: Auto reconstruction of a view based on its original textual definition is still potentially interesting, but I submit that it won't necessarily always give the right answer. Sure, it's another bullet to shoot yourself into someone elses foot. Jan --

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Bruce Momjian
Jan Wieck wrote: Tom Lane wrote: Auto reconstruction of a view based on its original textual definition is still potentially interesting, but I submit that it won't necessarily always give the right answer. Sure, it's another bullet to shoot yourself into someone elses foot. Do we want

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Christopher Kings-Lynne
We do, but as soon as you break the view by dropping an underlying object it fails to reconstruct. So having the original view definition at hand could be useful for some ALTER VIEW RECOMPILE command. Note that the assumptions underlying this discussion have changed in CVS tip: you

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Gavin Sherry
On Wed, 17 Jul 2002, Christopher Kings-Lynne wrote: We do, but as soon as you break the view by dropping an underlying object it fails to reconstruct. So having the original view definition at hand could be useful for some ALTER VIEW RECOMPILE command. Note that the assumptions

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Christopher Kings-Lynne
Hrm - looks like we really need CREATE OR REPLACE VIEW... I have written a patch for this. It is in an old source tree. I intend on getting it together by august, along with create or replace trigger. Sweet. I was going to email to see if you had a copy of your old create or replace

Re: [HACKERS] pg_views.definition

2002-07-16 Thread Joe Conway
Christopher Kings-Lynne wrote: We do, but as soon as you break the view by dropping an underlying object it fails to reconstruct. So having the original view definition at hand could be useful for some ALTER VIEW RECOMPILE command. Note that the assumptions underlying this discussion have

[HACKERS] pg_views.definition

2002-07-15 Thread Christopher Kings-Lynne
Hi, Would it be possible to add a new attribute to pg_views that stores the original view definition, as entered via SQL? This would make the lives of those of us who make admin interfaces a lot easier... Chris ---(end of broadcast)--- TIP 1:

Re: [HACKERS] pg_views.definition

2002-07-15 Thread Bruce Momjian
Christopher Kings-Lynne wrote: Hi, Would it be possible to add a new attribute to pg_views that stores the original view definition, as entered via SQL? This would make the lives of those of us who make admin interfaces a lot easier... We actually reverse it on the fly: