Re: Re: new type proposal

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: new type proposal
Date: 2001-02-07 09:39:36
Message-ID: 005b01c090e9$e44ff940$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Replying to my own post as I think things through.

----- Original Message -----
From: "Richard Huxton" <dev(at)archonet(dot)com>

> Maybe what we need is some sort of module system for these things so you
> could do something like:
>
> USE MODULE auto_timestamp ON foo (last_modified)
>
> which could apply the rules/triggers to the relevant table/column. Two
> big pluses I can think of:
>
> 1. It lets lots of non-developers contribute (e.g. me) without hacking C.
> 2. You are using standard language features so you can learn from
> modules or cut and paste if you loathe them.
>
> I don't know how complex module support would be, but CPAN doesn't seem
> to have done perl any harm.
>
> - Richard Huxton

Actually - we've pretty much got this in 7.1 anyway.
Plpgsql gives us EXECUTE <text> so we can generate triggers etc on the fly.
\i lets us parse a file

So - you could:

-- import functions from module
\i auto_timestamp.pgmod
-- add the triggers
auto_timestamp_addto(mytable,mycolumn)
-- remove the functions provided by the module
auto_timestamp_remove_module()

Does this make sense, or am I talking rubbish here?

- Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message fabrizio.ermini 2001-02-07 09:45:16 Re: Re: PostreSQL SQL for MySQL SQL
Previous Message Peter T Mount 2001-02-07 08:35:45 Re: [JDBC][INTERFACES][NOVICE] Postgresql inteface to Star Office using JDBC