From: Iklódi Lajos <il@mithrandir.hu>
To: Jan Wieck <janwieck@yahoo.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Cc: William Meloney <bmeloney@mindspring.com>
Subject: Re: Update in trigger
Date: Thu, 04 Apr 2002 05:41:22 +0200
Message-ID: <3CABCB62.6E94216@mithrandir.hu> (raw)
References: <200204031644.g33Gixc32234@saturn.janwieck.net>
Hi,
Jan Wieck írta:
> Are there appropriate indexes on the table updated in the
> trigger and is the database "VACUUM ANALYZE"ed so the indexes
> get used?
There is a primary key.
VACUUM ANALYZE is really helpful, but only for a few minutes (3000 inserted
records).
William Meloney írta:
> Please forward a copy of the trigger. This is exactly the same thing I
> am trying to do but I have not had any success.
Here is the whole structure:
CREATE TABLE nyadat (
nykod serial primary key,
nymekod int4 not null references mekonf,
nyatip int4 not null references nyatip,
nymeido timestamp,
nytarido timestamp default now(),
nyhossz int4,
nyadat bytea
) ;
CREATE TABLE szm (
kod serial primary key,
konfx int4,
csatx int4,
dparx int4,
nparx int4,
nyugtax int4,
parancsx int4,
esemenyx int4,
kalibrx int4,
nyx int4,
feldx int4,
kparx int4
) ;
create function nyx_fnc() returns opaque as '
begin
update szm set nyx = new.nykod where kod=1 ;
return new ;
end ;
' language 'plpgsql' ;
create trigger ny_x_trig after insert
on nyadat for each row execute procedure nyx_fnc() ;
Thanks for any help.
Lajos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: il@mithrandir.hu, janwieck@yahoo.com, bmeloney@mindspring.com
Subject: Re: Update in trigger
In-Reply-To: <3CABCB62.6E94216@mithrandir.hu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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