pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
RI_ConstraintTrigger_11264756
2+ messages / 2 participants
[nested] [flat]

* RI_ConstraintTrigger_11264756
@ 2003-07-31 19:18 Charles Hauser <chauser@duke.edu>
  2003-08-08 16:30 ` Re: RI_ConstraintTrigger_11264756 Jonathan Gardner <jgardner@jonathangardner.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Charles Hauser @ 2003-07-31 19:18 UTC (permalink / raw)
  To: pgsql-sql

All,

I have inherited a table (below) with a RI trigger.
I believe this table was created where both clone_id & blastx_id are FKs
w/ stipulation 'ON DELETE CASCADE'.

My question is, is this specified in the trigger:
RI_ConstraintTrigger_11264756?

If so how would I learn the content of the trigger knowing just the
trigger id (11264756)?

I have not seen a 'decoding' of triggers using pgsql.

regards,

Charles


CREATE TABLE clone_blastx(
	clone_id INTEGER NOT NULL REFERENCES clone(clone_id)  ON DELETE CASCADE,
	blastx_id INTEGER NOT NULL REFERENCES blastx(blastx_id)  ON DELETE CASCADE,
	UNIQUE(clone_id,blastx_id)
	);




  Column   |  Type   | Modifiers 
-----------+---------+-----------
 clone_id  | integer | 
 contig_id | integer | 
Indexes: clone_contig_clone_id_key unique btree (clone_id, contig_id),
         clone_id_clone_contig_key btree (clone_id),
         contig_id_clone_contig_key btree (contig_id)
Triggers: RI_ConstraintTrigger_11264756






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: RI_ConstraintTrigger_11264756
  2003-07-31 19:18 RI_ConstraintTrigger_11264756 Charles Hauser <chauser@duke.edu>
@ 2003-08-08 16:30 ` Jonathan Gardner <jgardner@jonathangardner.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Jonathan Gardner @ 2003-08-08 16:30 UTC (permalink / raw)
  To: Charles Hauser <chauser@duke.edu>; pgsql-sql

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

On Thursday 31 July 2003 12:18, Charles Hauser wrote:
> All,
>
> I have inherited a table (below) with a RI trigger.
> I believe this table was created where both clone_id & blastx_id are FKs
> w/ stipulation 'ON DELETE CASCADE'.
>
> My question is, is this specified in the trigger:
> RI_ConstraintTrigger_11264756?
>
> If so how would I learn the content of the trigger knowing just the
> trigger id (11264756)?
>
> I have not seen a 'decoding' of triggers using pgsql.
>

Look at the pg_trigger table. There is some documentation on what the various 
fields mean.

Normally, I see these triggers when I have declared a table to have a foreign 
key, or I created a table that has a foreign key that references this table.

I can usually decode who is referencing what from the tgargs column.

Example:
<unnamed>\000order_materials\000order_shipping\000UNSPECIFIED\000order_ship_id\000order_ship_id\000

Translates to:
order_materials.order_ship_id references order_shipping.order_ship_id

I have found a ton of these as I have upgraded from 7.2 to 7.3. I have dropped 
most of the triggers and altered the table to have the foreign keys to remedy 
this.


- -- 
Jonathan Gardner <jgardner@jonathangardner.net>
Live Free, Use Linux!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/M9BAWgwF3QvpWNwRAmrKAKDrkW914nrOqiUm4D9JCYsmD982awCfYh3T
pvdmcoJfo0f/bIFubyMUfbs=
=yzi0
-----END PGP SIGNATURE-----



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-08-08 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-31 19:18 RI_ConstraintTrigger_11264756 Charles Hauser <chauser@duke.edu>
2003-08-08 16:30 ` Jonathan Gardner <jgardner@jonathangardner.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox