Re: DROP/CREATE

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: DROP/CREATE
Дата
Msg-id AA30E7BCCA5C1D4E88A231900F8325C00BFD@dogbert.vale-housing.co.uk
обсуждение исходный текст
Ответ на DROP/CREATE  (Jean-Michel POURE <jm.poure@freesurf.fr>)
Список pgadmin-hackers
[resent...]

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm.poure@freesurf.fr]
> Sent: 21 October 2001 15:27
> To: pgadmin-hackers@postgresql.org
> Cc: dpage@vale-housing.co.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@postgresql.org)
http://pgadmin.postgresql.org/

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Rene Pijlman
Дата:
Сообщение: Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: [HACKERS] What about CREATE OR REPLACE FUNCTION?