Re: TODO item: support triggers on columns

Lists: pgsql-hackers
From: "Chris Mair" <list(at)1006(dot)org>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: TODO item: support triggers on columns
Date: 2005-03-10 17:06:42
Message-ID: 27188.193.206.186.101.1110474402.squirrel@www.endian.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

I'd like to start working on the following TODO item:
Referential Integrity / Support triggers on columns

Is somebody else already working on this?

Bye :)
Chris.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Chris Mair <list(at)1006(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-11 16:32:04
Message-ID: 200503111632.j2BGW4L05064@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Chris Mair wrote:
> Hello,
>
> I'd like to start working on the following TODO item:
> Referential Integrity / Support triggers on columns
>
> Is somebody else already working on this?

No one, I think.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Chris Mair <list(at)1006(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-11 17:12:03
Message-ID: 20050311171203.GF9495@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Mar 11, 2005 at 11:32:04AM -0500, Bruce Momjian wrote:
> Chris Mair wrote:
> > Hello,
> >
> > I'd like to start working on the following TODO item:
> > Referential Integrity / Support triggers on columns
> >
> > Is somebody else already working on this?
>
> No one, I think.

Isn't this the REFERENCING clause? I think there was a partial patch
submitted already for this.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
<Schwern> It does it in a really, really complicated way
<crab> why does it need to be complicated?
<Schwern> Because it's MakeMaker.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Chris Mair <list(at)1006(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-11 17:18:34
Message-ID: 200503111718.j2BHIYJ11643@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:
> On Fri, Mar 11, 2005 at 11:32:04AM -0500, Bruce Momjian wrote:
> > Chris Mair wrote:
> > > Hello,
> > >
> > > I'd like to start working on the following TODO item:
> > > Referential Integrity / Support triggers on columns
> > >
> > > Is somebody else already working on this?
> >
> > No one, I think.
>
> Isn't this the REFERENCING clause? I think there was a partial patch
> submitted already for this.

The patch appears unrelated to column-level triggers:

http://momjian.postgresql.org/cgi-bin/pgpatches2

---------------------------------------------------------------------------

The attached patch adds the optional REFERENCES syntax in CREATE TRIGGER
statement to make an automatic alias for OLD/NEW record during trigger
setup. The implementation of this new feature makes CREATE TRIGGER
command more compatible to SQL standard, and allows the future
implementation of executing SQL commands in trigger action.

After the implementation, the extended syntax of statement is as
follows.

CREATE TRIGGER name BEFORE|AFTER
INSERT|DELETE|UPDATE [OR...] ON tablename
[REFERENCING OLD|NEW [AS] identifier]
[FOR [EACH] ROW|STATEMENT]
EXECUTE PROCEDURE funcname (arguments)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Chris Mair <list(at)1006(dot)org>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-11 17:19:18
Message-ID: 1110561558.5533.27.camel@dell
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> > > I'd like to start working on the following TODO item:
> > > Referential Integrity / Support triggers on columns
> > >
> > > Is somebody else already working on this?
> >
> > No one, I think.
>
> Isn't this the REFERENCING clause? I think there was a partial patch
> submitted already for this.

Those are two different things:
http://www.postgresql.org/docs/8.0/static/sql-createtrigger.html#SQL-CREATETRIGGER-COMPATIBILITY

Bye, Chris.


From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Chris Mair <list(at)1006(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-12 21:51:23
Message-ID: 200503121651.23377.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Friday 11 March 2005 12:18, Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > On Fri, Mar 11, 2005 at 11:32:04AM -0500, Bruce Momjian wrote:
> > > Chris Mair wrote:
> > > > Hello,
> > > >
> > > > I'd like to start working on the following TODO item:
> > > > Referential Integrity / Support triggers on columns
> > > >
> > > > Is somebody else already working on this?
> > >
> > > No one, I think.
> >
> > Isn't this the REFERENCING clause? I think there was a partial patch
> > submitted already for this.
>
> The patch appears unrelated to column-level triggers:
>
> http://momjian.postgresql.org/cgi-bin/pgpatches2
>

It is unrelated, but AFAIK Greg Mullane is working on this (actual column
based triggers) and has the intial workings of a patch already in
progress.... I'm CC'ing him so he can clarify but I'd hold off till you spoke
with him... and we should probably update the TODO once he speaks up as well.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-13 14:18:12
Message-ID: 4e8e6eb664ad433f5d179ba231cca045@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I'd like to start working on the following TODO item:
> Referential Integrity / Support triggers on columns
>
> Is somebody else already working on this?

Sorry for not jumping in earlier. As Rob said, I am working on
column-level support for triggers. I did not have my name addded
to the TODO list as I wanted to at least get a proof of concept
going first to make sure I could undertake it. I am partway there,
but there are still a lot of rough edges. I guess at this point
I should formally put my name on the TODO, and can bail out if
it gets over my head?

By the way, does anyone know what the tgattr field in pg_triggers
is for? It's allocated but never populated, and would be perfect
for my purposes on this patch, but I don't want to use it if it is
being reserved for something else.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200503121915
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCM4ZwvJuQZxSWSsgRAhesAKCXi468EyjJ77yMW83Zuoy9glm6XACgxBod
3PZ+l26fRrPY5glMpY+6gxM=
=P+cR
-----END PGP SIGNATURE-----


From: Chris Mair <list(at)1006(dot)org>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-13 14:34:13
Message-ID: 1110724453.4438.12.camel@dell
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> > I'd like to start working on the following TODO item:
> > Referential Integrity / Support triggers on columns
> >
> > Is somebody else already working on this?
>
> Sorry for not jumping in earlier. As Rob said, I am working on
> column-level support for triggers. I did not have my name addded
> to the TODO list as I wanted to at least get a proof of concept
> going first to make sure I could undertake it. I am partway there,
> but there are still a lot of rough edges. I guess at this point
> I should formally put my name on the TODO, and can bail out if
> it gets over my head?

Ok!
Keep us up to date.

Bye, Chris :)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-13 18:47:59
Message-ID: 18185.1110739679@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Greg Sabino Mullane" <greg(at)turnstep(dot)com> writes:
> By the way, does anyone know what the tgattr field in pg_triggers
> is for?

http://developer.postgresql.org/docs/postgres/catalog-pg-trigger.html
says "currently unused" and a desultory search through the sources
confirms that. I imagine it was put there with the intent of adding
column info later on. However, being a fixed-width array, I don't
actually see that it would be useful for anything much ... you'd at
least want to change it to a normal array.

BTW, if you don't have a convenient way of grepping the entire PG
source tree and quickly viewing all the hits on a particular symbol,
I *highly* recommend setting up something that can do that. I use
emacs + glimpse but there are probably newer tools out there.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-14 03:00:37
Message-ID: 200503140300.j2E30bT24931@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Sabino Mullane wrote:
[ There is text before PGP section. ]
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> > I'd like to start working on the following TODO item:
> > Referential Integrity / Support triggers on columns
> >
> > Is somebody else already working on this?
>
> Sorry for not jumping in earlier. As Rob said, I am working on
> column-level support for triggers. I did not have my name addded
> to the TODO list as I wanted to at least get a proof of concept
> going first to make sure I could undertake it. I am partway there,
> but there are still a lot of rough edges. I guess at this point
> I should formally put my name on the TODO, and can bail out if
> it gets over my head?

Added to TODO.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO item: support triggers on columns
Date: 2005-03-15 02:13:59
Message-ID: 84ebe273479dccc6f8a6276eae9e9853@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Lane wrote:
> http://developer.postgresql.org/docs/postgres/catalog-pg-trigger.html
> says "currently unused" and a desultory search through the sources
> confirms that. I imagine it was put there with the intent of adding
> column info later on. However, being a fixed-width array, I don't
> actually see that it would be useful for anything much ... you'd at
> least want to change it to a normal array.

I grepped the sources and saw the same: I just wanted to make sure
that nobody had any plans on it. If so, speak now, for I am planning on
using it. As for the type, I presume you mean something like grolist in
pg_group would be more applicable than indkey in pg_index.

> BTW, if you don't have a convenient way of grepping the entire PG
> source tree and quickly viewing all the hits on a particular symbol,
> I *highly* recommend setting up something that can do that. I use
> emacs + glimpse but there are probably newer tools out there.

I actually use emacs and glimpse, but not together. I won't bother to
ask if emacs has a glimpse-mode: it's emacs after all, so of course
it does. :) I'll have to give it a shot.

Thank,
- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200503140712
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCNX/AvJuQZxSWSsgRAiq8AKD6+5GGa8Eh28acVHvx/0RZWpKBwwCgyDeD
GojL9ZIFiUUDT0ZjIsuQ4Dk=
=QivK
-----END PGP SIGNATURE-----