Re: RE : full featured alter table?

Enrico Weigelt <weigelt@metux.de>

From: weigelt@metux.de
To: pgsql-general@postgresql.org
Date: 2003-06-16T22:15:22Z
Lists: pgsql-general
On Mon, Jun 16, 2003 at 09:26:12PM +0200, Tino Wildenhain wrote:

<snip>
> I think there are quite more praxis relevant problems to solve :)
ACK.

I'd like to see some features, which can be good for distributed databases:

* user defined OID spaces for serveral classes (and their derived classes)
* automatic mtime field update (but only if data really changed)

At the moment i'm doing this in the application (some not-too-small 
php code), but it would be nice if the RDBMS could do this, so this
functionality could be provided directly through an SQL interface.

For many applications i use an object-like table model: each table 
is derived from _inode, which defines an (cluster wiede) unique inode_id
and an mtime field. The applications do not make direct queries, but
access the db over an abstraction layer instead. This layer has definitions
for each class (object type, properties, etc) and generates queries for
actions like create, update, query, get,... It also implements some 
little caching. On create() the abstraction layer generates an query which
fetches the inode_id from an sequence (this sequence has to be adjusted
for each node in the cluster, so each node has its own inode_id space)
and sets the mtime to current_timestamp(). On update() it also updates
the mtime field. But also there's an raw-store mode, which does _not_
update the mtime field, but writes it as it comes from the user
(this is necessary for syncing to avoid loops, since the post-out
uses the mtime to find out which records to send to another node)

I've tried to achieve this w/ rules, but i couldnt handle this
(perhaps i'm too stupid ? ;-))

cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux ITS 
 Webhosting ab 5 EUR/Monat.          UUCP, rawIP und vieles mehr.

 phone:     +49 36207 519931         www:       http://www.metux.de/     
 fax:       +49 36207 519932         email:     contact@metux.de
 cellphone: +49 174 7066481	     smsgate:   sms.weigelt@metux.de
---------------------------------------------------------------------
 Diese Mail wurde mit UUCP versandt.      http://www.metux.de/uucp/