Re: Pseudo modification of views and triggers (again)

From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Pseudo modification of views and triggers (again)
Date: 2002-02-19 21:19:12
Message-ID: 200202192119.g1JLJCFP020590@www1.translationforge
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Matthew M. 2002-02-19 22:17:50 Re: [GENERAL] MDB 2 POSTGRESQL MIGRATION PROBLEM
Previous Message Dave Page 2002-02-19 20:58:48 Re: Pseudo modification of views and triggers (again)