> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm(dot)poure(at)freesurf(dot)fr]
> Sent: 21 October 2001 15:27
> To: pgadmin-hackers(at)postgresql(dot)org
> Cc: dpage(at)vale-housing(dot)co(dot)uk
> Subject: DROP/CREATE
> Hello Dave and all,
> Views are based on OIDs and there is not simple way to implement
> DROP/CREATE VIEW in pgAdmin II. Seems more easy for CREATE OR REPLACE
> TRIGGER. I posted today a mail on pg-hackers to ask if someone could
> implement CREATE OR REPLACE directly in PostgreSQL.
Yes, I saw your email. Actually, editting a view in pgSchema is probably not
that hard as pgSchema doesn't give two hoots about the change in OID - what
is more difficult is renaming an object or changing anything that would
affect the .Identifier property. In reality, the biggest issue with this in
pgSchema is probably that no dependency checking will be done. For a
'standalone' view, this is fine, but if the view is used in another view or
a function then that will break (I think I'm teaching my Grandmother to suck
eggs here Jean-Michel!).
To edit a view in pgSchema, a Public Property Definition(vData As String) is
required in pgView.cls. This will:
1) Attempt to create a view with the new definition to ensure it's valid.
2) Drop the old view.
3) Create the new view.
4) Re-apply any comments and ACLs.
5) Query pg_class for the updated OID.
Job's done! Actually, probably the hardest bit is resetting the ACL. In
theory, the same could be achieved for Triggers, although you wouldn't be
able to change the Table.
In other news:
- pgadmin.org is now registered. It's (well, www.pgadmin.org) setup
currently with frames based forwarding to pgadmin.postgresql.org.
- pgAdmin II has now been run and (not extensively) tested on Windows XP
Professional (release version). All seems OK...
Dave Page (dpage(at)postgresql(dot)org)
pgadmin-hackers by date
|Next:||From: Hannu Krosing||Date: 2001-10-29 07:32:46|
|Subject: Re: [HACKERS] What about CREATE OR REPLACE FUNCTION?|
|Previous:||From: Jean-Michel POURE||Date: 2001-10-27 13:50:11|
|Subject: Re: CREATE OR REPLACE VIEW/TRIGGER|