The suggestions received have worked well for one update in the row.
However, if I make any other update on the same row the trigger fires and
more inserts are generated.
However. I have found that the 8.5 alpha version has this addition -
http://developer.postgresql.org/pgdocs/postgres/release-8-5.html
"Add a WHEN clause to CREATE TRIGGER, allowing a boolean expression to be
checked to determine whether the trigger should be fired."
Would this change solve my problem, or is there another solution around?
Bob
----- Original Message -----
From: "Adrian Klaver" <adrian.klaver@gmail.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Tom Lane" <tgl@sss.pgh.pa.us>; "Postgresql"
<pgsql-general@postgresql.org>
Sent: Saturday, January 23, 2010 10:06 AM
Subject: Re: [GENERAL] Old/New
> On Saturday 23 January 2010 7:51:28 am Bob Pawley wrote:
>> I havn't been able to find documentation on how to use \d. When I open
>> the
>> psql interface (through either port ) it asks for a password but doesn't
>> allow any entry of a password.
>
> That would depend on the settings in pg_hba.conf, whether you have
> passwords
> enabled for the connection or not. I am not sure what you either port? Are
> you
> referring to the port address and the local socket?
>
>>
>> However, after my last e-mail to you, I came across something
>> interesting -
>> at least to me.
>>
>> I use pg_admin scripts to modify triggers.
>>
>> Looking through pg_admin at all of the triggers on the p_id.processes
>> table
>> I just happened to click on the trigger we have been discussing and then
>> clicked its refresh button.
>>
>> Using the same update statement and the same After Update trigger that
>> inserted two rows into p_id.devices it now inserted only one row and that
>> row was the correct row.
>>
>> I don't know enough about the interaction between the unrefreshed copy of
>> a
>> trigger held by pg_admin and the updated trigger installed in the server
>> to
>> comment - however there does seem to be a connection of which I wasn't
>> aware.
>
> Can't help you there I don't use pgAdmin.
>
>>
>> Bob
>>
>
>
>
> --
> Adrian Klaver
> adrian.klaver@gmail.com