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

Re: Pseudo modification of views and triggers (

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'jm(dot)poure(at)freesurf(dot)fr'" <jm(dot)poure(at)freesurf(dot)fr>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Pseudo modification of views and triggers (
Date: 2002-02-20 08:17:08
Message-ID: FED2B709E3270E4B903EB0175A49BCB10475BC@dogbert.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm(dot)poure(at)freesurf(dot)fr] 
> Sent: 19 February 2002 21:19
> To: Dave Page
> Cc: pgadmin-hackers(at)postgresql(dot)org
> Subject: Re: [pgadmin-hackers] Pseudo modification of views 
> and triggers (again)
> 
> 
> > 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.

Yes, it is. The beauty of the code we've written though, is that it will
take minutes to convert to CREATE OR REPLACE when it is available.

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

Does it? I wasn't aware of that.

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

Doubtful. I believe ALTER TABLE works for sequences & views because they
live in pg_class. I guess ALTER TABLE RENAME just doesn't check or care
about relkind.

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

Hopefully, but let's get Views & Triggers nailed first.

BTW, have you been following the discussion on pgsql-hackers about the
ongoing pl/pgSQL drop column code?

Regards, Dave.

Responses

pgadmin-hackers by date

Next:From: Jean-Michel POUREDate: 2002-02-20 09:21:18
Subject: Re: Pseudo modification of views and triggers ( again)
Previous:From: Matthew M.Date: 2002-02-19 22:17:50
Subject: Re: [GENERAL] MDB 2 POSTGRESQL MIGRATION PROBLEM

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