Skip site navigation (1) Skip section navigation (2)

Re: DROP/CREATE

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: DROP/CREATE
Date: 2001-10-28 21:12:57
Message-ID: AA30E7BCCA5C1D4E88A231900F8325C00BFD@dogbert.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgadmin-hackers
[resent...]

> -----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...

Cheers, Dave.


-- 
Dave Page (dpage(at)postgresql(dot)org)
http://pgadmin.postgresql.org/ 

pgadmin-hackers by date

Next:From: Hannu KrosingDate: 2001-10-29 07:32:46
Subject: Re: [HACKERS] What about CREATE OR REPLACE FUNCTION?
Previous:From: Jean-Michel POUREDate: 2001-10-27 13:50:11
Subject: Re: CREATE OR REPLACE VIEW/TRIGGER

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group