Re: Pseudo modification of views and triggers (again) - Mailing list pgadmin-hackers

From Jean-Michel POURE
Subject Re: Pseudo modification of views and triggers (again)
Date
Msg-id 200202192119.g1JLJCFP020590@www1.translationforge
Whole thread Raw
In response to Re: Pseudo modification of views and triggers (again)  (Dave Page <dpage@vale-housing.co.uk>)
List pgadmin-hackers
> I've just found out that views can be renamed using ALTER TABLE <viewname>
> RENAME... iirc, VIEWs are referred to by OID from PL/SQL functions & other
> views, and by name from pl/pgsql functions.
OK. Since we can modify PL/pgSQL functions, it is no problem.
It is a pitty we don't have CREATE OR REPLACE VIEW anyway.

> Sequences can also be renamed in this way.
Great. It also works for indexes. So interesting.

> I would suggest (in pgSchema) saving the definition in a local variable
> before the update attempt, then if an error occurs, re-run the old SQL.
Yes.

> NOTE: I also noticed that you do not retrieve the new OID. This could be
> done along with the definition.
Yes, you are right.

> Triggers could be implemented exactly as Views. Each property will need to
> be handled seperately, though in the future we might look into merging
> multiple updates into one.
Can we rename a trigger with ALTER TABLE RENAME ?

> The Name property must be handled differently (as it would be for Views &
> Sequences) in the Collection class. This has already been done for tables,
> so there is some example code to steal.
You already did 99% of the job and I wron't complain about it.

The next big thing now is table pseudo-modification. We should be able to
provide a very nice solution.

Cheers,
Jean-Michel

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Pseudo modification of views and triggers (again)
Next
From: "Matthew M."
Date:
Subject: Re: [GENERAL] MDB 2 POSTGRESQL MIGRATION PROBLEM