> At the very least it should not have a hard-coded field name in it. You
> should pass the field name to be set as a parameter in the trigger setup.
>
> That's probably a lot more doable if the trigger is written in C, and in any
> case I think any prepackaged triggers we provide should be written
Christopher Browne wrote:
I think this is a TODO, but not sure who is working on it or what needs to be
done. The generic version in pagila is perhaps not generic enough:
CREATE FUNCTION last_updated() RETURNS trigger
AS $$
BEGIN
NEW.last_update = CURRENT_TIMESTAMP;
RETURN NEW;
EN
Christopher Browne wrote:
>On Wed, Feb 4, 2009 at 1:23 PM, Bruce Momjian wrote:
>> Robert Treat wrote:
>>> On Wednesday 21 January 2009 20:21:41 Bruce Momjian wrote:
>>> CREATE FUNCTION last_updated() RETURNS trigger
>>> AS $$
>>> BEGIN
>>> NEW.last_update = CURRENT_TIMESTAMP;
>>> RETU
On Wed, Feb 4, 2009 at 1:23 PM, Bruce Momjian wrote:
> Robert Treat wrote:
>> On Wednesday 21 January 2009 20:21:41 Bruce Momjian wrote:
>> > Alvaro Herrera wrote:
>> > > Robert Treat wrote:
>> > > > On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
>> > > > > David Fetter wrote:
>> > >
>> >
On Wed, Feb 04, 2009 at 01:23:04PM -0500, Bruce Momjian wrote:
> Robert Treat wrote:
> > On Wednesday 21 January 2009 20:21:41 Bruce Momjian wrote:
> > > Alvaro Herrera wrote:
> > > > Robert Treat wrote:
> > > > > On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
> > > > > > David Fetter wrot
Robert Treat wrote:
> On Wednesday 21 January 2009 20:21:41 Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> > > Robert Treat wrote:
> > > > On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
> > > > > David Fetter wrote:
> > >
> > > Ref: http://archives.postgresql.org/pgsql-hackers/2008-05/ms
On Wednesday 21 January 2009 20:21:41 Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > Robert Treat wrote:
> > > On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
> > > > David Fetter wrote:
> >
> > Ref: http://archives.postgresql.org/pgsql-hackers/2008-05/msg00198.php
> >
> > > > > 1. Creat
Alvaro Herrera wrote:
> Robert Treat wrote:
> > On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
> > > David Fetter wrote:
>
> Ref: http://archives.postgresql.org/pgsql-hackers/2008-05/msg00198.php
>
> > > > 1. Create a generic (possibly overloaded) trigger function, bundled
> > > > with
Robert Treat wrote:
> On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
> > David Fetter wrote:
Ref: http://archives.postgresql.org/pgsql-hackers/2008-05/msg00198.php
> > > 1. Create a generic (possibly overloaded) trigger function, bundled
> > > with PostgreSQL, which sets a field to some
On Thu, May 08, 2008 at 08:44:46AM +0200, Martijn van Oosterhout wrote:
> On Wed, May 07, 2008 at 03:04:49PM -0700, David Fetter wrote:
> > 1. Create a generic (possibly overloaded) trigger function,
> > bundled with PostgreSQL, which sets a field to some value. For
> > example, a timestamptz ver
On Thu, 2008-05-08 at 00:41 -0400, Tom Lane wrote:
> Tino Wildenhain <[EMAIL PROTECTED]> writes:
> > I may be wrong but my feeling is, not to much weirdness in the core
> > please :)
>
> +1 ... we have wasted more than enough man-hours trying to get the magic
> "serial" type to play nicely. If I
DF,
> 2. Have some kind of pre-processing of CREATE and ALTER statements on
> tables which would attach the above function to the field at hand,
> something like:
>
> CREATE TABLE foo(
> last_updated TIMESTAMPTZ_UPDATED(),
So you're suggesting a user-definable version of SERIAL?
--
Josh Be
On Thursday 08 May 2008 00:27:10 Tino Wildenhain wrote:
> David Fetter wrote:
> > Folks,
> >
> > A co-worker pointed out to me that MySQL has a feature that, properly
> > implemented and maybe extended, could be handy, namely what MySQL
> > calls a "timestamp" field, so here's a proposal:
> >
> > 1
Zoltan Boszormenyi írta:
Martijn van Oosterhout írta:
On Wed, May 07, 2008 at 03:04:49PM -0700, David Fetter wrote:
1. Create a generic (possibly overloaded) trigger function, bundled
with PostgreSQL, which sets a field to some value. For example, a
timestamptz version might set the field t
Martijn van Oosterhout írta:
On Wed, May 07, 2008 at 03:04:49PM -0700, David Fetter wrote:
1. Create a generic (possibly overloaded) trigger function, bundled
with PostgreSQL, which sets a field to some value. For example, a
timestamptz version might set the field to now().
Doesn't t
On Wed, May 07, 2008 at 03:04:49PM -0700, David Fetter wrote:
> 1. Create a generic (possibly overloaded) trigger function, bundled
> with PostgreSQL, which sets a field to some value. For example, a
> timestamptz version might set the field to now().
Doesn't the SQL standard GENERATED BY functi
Tino Wildenhain <[EMAIL PROTECTED]> writes:
> I may be wrong but my feeling is, not to much weirdness in the core
> please :)
+1 ... we have wasted more than enough man-hours trying to get the magic
"serial" type to play nicely. If I had it to do over, we'd never have
put that in at all. The und
David Fetter wrote:
Folks,
A co-worker pointed out to me that MySQL has a feature that, properly
implemented and maybe extended, could be handy, namely what MySQL
calls a "timestamp" field, so here's a proposal:
1. Create a generic (possibly overloaded) trigger function, bundled
with PostgreSQ
Folks,
A co-worker pointed out to me that MySQL has a feature that, properly
implemented and maybe extended, could be handy, namely what MySQL
calls a "timestamp" field, so here's a proposal:
1. Create a generic (possibly overloaded) trigger function, bundled
with PostgreSQL, which sets a field
19 matches
Mail list logo