Heh, it's me spamming you again :)
now -- asking for comments.
> > create trigger fsl_update instead of insert or update on fsl ...
> >
> > but till now did not succeed in it. Quick googlink did not help either.
>
> Argh. My google-fu is definitely low in the night ;)
>
> for the record: it'
On Wed, 4 Sep 2013, Dmitry Morozovsky wrote:
> Dear colleagues,
>
> I'm running Pg 9.1 and have schema like the following:
[snip]
> I understand I should use smth like
>
> create trigger fsl_update instead of insert or update on fsl ...
>
> but till now did not succeed in it. Quick googlink
On 2012-10-19, Victor Sterpu wrote:
> I have this trigger that works fine. The trigger prevents the deletion
> of the last record.
> But I want skip this trigger execution when the delete is done from a
> external key.
> How can I do this?
perhaps you have to use a rule instead of a trigger?
-
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-
> ow...@postgresql.org] On Behalf Of Victor Sterpu
> Sent: Friday, October 19, 2012 2:15 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Trigger triggered from a foreign key
>
> I have this trigger that works
Tom Lane schrieb:
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
I have defined an BEFORE UPDATE trigger. The trigger catch every update,
change some columns of the new row, make an insert of the new row and
returns null to abort the update.
Why in the world would you do that? Just return t
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
> I have defined an BEFORE UPDATE trigger. The trigger catch every update,
> change some columns of the new row, make an insert of the new row and
> returns null to abort the update.
Why in the world would you do that? Just return the modified row
Hey Dmitriy,
thanks for your reply.
I think, its would be better to use rule on update instead of the trigger
in such case as you.
I've played the whole weekend with the rule-system, but it didn't work
for my case. I have a dynamic trigger, which takes cares about revision
of rows for every
Jasen Betts schrieb:
On 2010-05-11, Torsten Zühlsdorff wrote:
Hello,
i have a problem with a trigger written in pl/pgsql.
It looks like this:
CREATE OR REPLACE FUNCTION versionize()
RETURNS TRIGGER
AS $$
BEGIN
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not
On 2010-05-11, Torsten Zühlsdorff wrote:
> Hello,
>
> i have a problem with a trigger written in pl/pgsql.
>
> It looks like this:
>
> CREATE OR REPLACE FUNCTION versionize()
> RETURNS TRIGGER
> AS $$
> BEGIN
>
>NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
>
>/* not w
On 05/11/10 18:26, Torsten Zühlsdorff wrote:
Tom Lane schrieb:
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
*/
RETU
Torsten,
Usually, the “insert ... (select ...)” has the select portion enclosed in
parenthesis. Don't know if solution is that simple but did not see it in your
examples. It may be worth a try.
Stuart
- Original message -
> Hello,
>
> i have a problem with a trigger written in pl/pgs
Tom Lane schrieb:
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
*/
RETURN NULL;
This seems like the
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
>NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
>/* not working line, just a stub:
>EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
>*/
>RETURN NULL;
This seems like the hard way. Why do
On Mon, Mar 1, 2010 at 9:10 PM, Ray Madigan wrote:
>
> What I want to do is when I do a SELECT on the Catalog and deliver the
> result to the user, I want to check to see if the FooKey is in the users
> ToDo table and set the value of a column isToDo to true or false depending
> on if the FooKey e
Are you able to set up a SELECT query to get the result you want? If
you are, it's as simple as putting "CREATE VIEW viewname AS ", followed
by your query.
Garrett Murphy
_
From: pgsql-sql-ow...@postgresql.org
[mailto:pgsql-sql-ow...@postgresql.org] On
Sridhar Reddy Ratna wrote:
>
> cmd := 'INSERT INTO ' || dateTable ||
> EXECUTE cmd;
> RETURN NEW;
> If I changed the RETURN NEW to RETURN NULL its inserting only one row.
Yes. RETURN NEW allows the insert to procede normally so you end up with
the two rows.
> But to work wi
Sridhar ratna
-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of Richard Huxton
Sent: Wednesday, September 09, 2009 3:35 PM
To: Sridhar Reddy Ratna
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] trigger failed to
Sridhar Reddy Ratna wrote:
>
> dateTable := coll_fp_subdtls_01;
>
> ELSE
>
> dateTable := coll_fp_subdtls_02;
> ERROR: column "coll_fp_subdtls_01" does not exist
>
> ERROR: column "coll_fp_subdtls_01" does not exist
I think you mi
Sigrid Thijs writes:
> I've bumped into a problem with a trigger before delete that I do not
> immediately understand. I have made a simple example that also illustrates
> the issue, but in reality the database structure is more complex.
The reason it doesn't work is that the delete from member c
I would develop like this (No so many changes, it is basically a small
trigger)
create or replace function compound_rows_range_check() returns trigger as
$body$
DECLARE
BAYNO int4;
BEGIN
-- First Verification = if changing compound or row fail
IF (old.co_id <> new.co_id or
old.cr_id <>
I have managed to develop one solution using functions and triggers. Has
anyone got a better solution?
Gary
create unique index "compound_bays_unique_index" on compound_bays using btree
(co_id,cr_id,cb_id);
create or replace function compound_rows_range_check() returns trigger as
$proc$
DECLA
With some version (but I don't remember which) I had the same problem.
I solved it by assigning TG_ARGV[0] to a variable and use the variable in the
RAISE NOTICE.
>>> Tom Lane <[EMAIL PROTECTED]> 2008-10-09 19:22 >>>
"Marcin Krawczyk" <[EMAIL PROTECTED]> writes:
> And here's what RAISE NOTICE lo
"Marcin Krawczyk" <[EMAIL PROTECTED]> writes:
> And here's what RAISE NOTICE looks like : NOTICE: TG_ARGV = ,
> TG_NARGS = 0, par =
> What's wrong with it ?? I'm running 8.1.4
Works for me:
regression=# insert into test_table values(1);
INSERT 0 1
regression=# update test_table set f1 = 2;
NOTI
On Wed, Sep 17, 2008 at 5:45 PM, hubert depesz lubaczewski
<[EMAIL PROTECTED]> wrote:
> On Wed, Sep 17, 2008 at 05:08:39PM +0200, Raphael Bauduin wrote:
>> Would you have a little example on how you would do it?
>
> show us what you have done - it will be easier to find/fix/explain than
> to write
HI,
On Sat, Aug 11, 2007 at 9:07 PM, hubert depesz lubaczewski
<[EMAIL PROTECTED]> wrote:
> On Sat, Aug 11, 2007 at 02:45:09AM -0500, Javier Fonseca V. wrote:
>> I think that it's working alright except for the next line:
>
> doing this in plpgsql is very complicated (or even impossible assuming
>
On 11/01/2008, Simon Riggs <[EMAIL PROTECTED]> wrote:
>
> On Fri, 2008-01-11 at 08:24 +, Richard Huxton wrote:
>
> > I've always considered TRUNCATE to be DDL rather than DML. I mentally
> > group it with DROP TABLE rather than DELETE>
>
> DDL/DML probably isn't the right split, since its then
Added to TODO:
> * Add ability to trigger on TRUNCATE
>
> http://archives.postgresql.org/pgsql-sql/2008-01/msg00050.php
---
Simon Riggs wrote:
> On Fri, 2008-01-11 at 08:24 +, Richard Huxton wrote:
>
> > I've always
On Fri, 2008-01-11 at 08:24 +, Richard Huxton wrote:
> I've always considered TRUNCATE to be DDL rather than DML. I mentally
> group it with DROP TABLE rather than DELETE>
DDL/DML probably isn't the right split, since its then arguable as to
which group of commands it belongs in.
I see we
On Jan 11, 2008, at 2:24 AM, Richard Huxton wrote:
Tom Lane wrote:
Alvaro Herrera <[EMAIL PROTECTED]> writes:
My thinking is that a TRUNCATE trigger is a per-statement trigger
which
doesn't have access to the set of deleted rows (Replicator uses
it that
way -- we replicate the truncate act
Tom Lane wrote:
Alvaro Herrera <[EMAIL PROTECTED]> writes:
My thinking is that a TRUNCATE trigger is a per-statement trigger which
doesn't have access to the set of deleted rows (Replicator uses it that
way -- we replicate the truncate action, and replay it on the replica).
In that way it would
[EMAIL PROTECTED] (Tom Lane) writes:
> Alvaro Herrera <[EMAIL PROTECTED]> writes:
>> Gerardo Herzig escribió:
>>> Yes, the TRUNCATE statement is not sql ansi, maybe is a more low level
>>> thing than i think.
>
>> TRUNCATE currently does not fire triggers, but that doesn't mean it's
>> impossible
Alvaro Herrera wrote:
> My thinking is that a TRUNCATE trigger is a per-statement trigger which
> doesn't have access to the set of deleted rows.
> In that way it would be different from a per-statement trigger for
> DELETE.
Completely agree.
A truncate trigger should run a different function
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> My thinking is that a TRUNCATE trigger is a per-statement trigger which
> doesn't have access to the set of deleted rows (Replicator uses it that
> way -- we replicate the truncate action, and replay it on the replica).
> In that way it would be differen
Tom Lane wrote:
Alvaro Herrera <[EMAIL PROTECTED]> writes:
Gerardo Herzig escribió:
Yes, the TRUNCATE statement is not sql ansi, maybe is a more low level
thing than i think.
TRUNCATE currently does not fire triggers, but that doesn't mean it's
impossible to do it. I thin
Tom Lane escribió:
> Alvaro Herrera <[EMAIL PROTECTED]> writes:
> > Gerardo Herzig escribi�:
> >> Yes, the TRUNCATE statement is not sql ansi, maybe is a more low level
> >> thing than i think.
>
> > TRUNCATE currently does not fire triggers, but that doesn't mean it's
> > impossible to do it. I
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Gerardo Herzig escribió:
>> Yes, the TRUNCATE statement is not sql ansi, maybe is a more low level
>> thing than i think.
> TRUNCATE currently does not fire triggers, but that doesn't mean it's
> impossible to do it. I think it would be fairly easy to
Gerardo Herzig escribió:
> Yes, the TRUNCATE statement is not sql ansi, maybe is a more low level
> thing than i think.
TRUNCATE currently does not fire triggers, but that doesn't mean it's
impossible to do it. I think it would be fairly easy to add support
for that.
Currently, Mammoth Replica
Pavel Stehule wrote:
On 08/01/2008, Chris Browne <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] (Gerardo Herzig) writes:
Hi all. Acording to the docs, TRUNCATE will not fire a DELETE trigger
on the table being truncated.
There is a way to capture a TRUNCATE in any way?
I think th
Hello
theoretically you can have trigger on any statement, but I am not sure
about conformance with std. But, you can wrap TRUNCATE statement into
some procedure, and then call this procedure with some other actions.
Regards
Pavel Stehule
On 08/01/2008, Chris Browne <[EMAIL PROTECTED]> wrote:
>
[EMAIL PROTECTED] (Gerardo Herzig) writes:
> Hi all. Acording to the docs, TRUNCATE will not fire a DELETE trigger
> on the table being truncated.
> There is a way to capture a TRUNCATE in any way?
I think there's some sort of "to do" on that...
It ought to be not *too* difficult (I imagine!) to
Ouch, that hurts! It suddenly dawns on me . . . Big difference on table
that you specify and table where it
actually takes effect. Confusing at first. Thanks a million, Tom.
"Rolf A. de By" <[EMAIL PROTECTED]> writes:
Yes, this is an inheritance set-up. But actually no: I am executing al
"Rolf A. de By" <[EMAIL PROTECTED]> writes:
> Yes, this is an inheritance set-up. But actually no: I am executing all
> my data changes against the parent table, and want the trigger on that
> parent table to fire for an insert on the parent table as it does. But
> I also want the trigger to f
Thanks Tom,
Yes, this is an inheritance set-up. But actually no: I am executing all
my data changes against the parent table, and want the trigger on that
parent table to fire for an insert on the parent table as it does. But
I also want the trigger to fire when an update on the parent table
"Rolf A. de By" <[EMAIL PROTECTED]> writes:
> Thanks for that. There is some misunderstanding here. For this example,
> I had taken the sting out of my trigger function and turned it into a
> much more concise no-op, with warnings. The actual code of my original
> trigger function is irrelevan
Erik,
Thanks for that. There is some misunderstanding here. For this example,
I had taken the sting out of my trigger function and turned it into a
much more concise no-op, with warnings. The actual code of my original
trigger function is irrelevant. The no-op trigger function displays the
On Dec 12, 2007, at 3:38 PM, Rolf A. de By wrote:
Greetings list,
Running pg 8.2.3. on a windows machine, I have become blind in a
trigger definition puzzle, so hope that somebody may help me
understand where I goof.
I have a base table i_s that has three tables that inherit from it,
chester c young wrote:
> how are you preventing recursion?
>
>
That could be the problem, suggestions?
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
On Sat, Aug 11, 2007 at 02:45:09AM -0500, Javier Fonseca V. wrote:
> I think that it's working alright except for the next line:
doing this in plpgsql is very complicated (or even impossible assuming
that any table can have the same trigger). i would rather suggest using
pl/perl - writing somethin
Yes Tom, you're right, but the real problem is that I need to use an EXECUTE
statement because my table name is dynamic. In your example, you used logt
as a static table name, and that doesn't need an EXECUTE statement.
So I think that I'll have to rewrite a Trigger Procedure for each table and
t
2007/8/11, Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
> > NEW is only plpgsql variable. It isn't visible on SQL level.
>
> Correct, but:
>
> > You cannot use new.*, you can:
> > execute 'INSERT ...' || 'VALUES(' || new.a || ',' || new.b
>
> You're both overthin
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> NEW is only plpgsql variable. It isn't visible on SQL level.
Correct, but:
> You cannot use new.*, you can:
> execute 'INSERT ...' || 'VALUES(' || new.a || ',' || new.b
You're both overthinking the problem. In recent releases (at least
since 8.
NEW is only plpgsql variable. It isn't visible on SQL level. You
cannot use new.*, you can:
execute 'INSERT ...' || 'VALUES(' || new.a || ',' || new.b
regards
Pavel
2007/8/11, Javier Fonseca V. <[EMAIL PROTECTED]>:
>
>
> Hello.
>
> I'm doing a Trigger Procedure in pl/pgSQL. It makes some k
> > does the post trigger on A wait until post trigger on B is
> executed? -> > this seems intuitive to me.
>
> How can it wait until the trigger on B is executed if the trigger on
> B doesn't
> actually get triggered until someone updates B and it's the trigger
> on A
> doing the update?
trigge
"chester c young" <[EMAIL PROTECTED]> writes:
> tables A and B: a post row trigger on A cause updates on B which has
> its own post row trigger.
>
> does the post trigger on A wait until post trigger on B is executed? -
> this seems intuitive to me.
How can it wait until the trigger on B is execu
On 8/31/06, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote:
Bono,I must check each insert on my Points(each shop generate a new line on Points table).When I insert the record on points I must see the field Value(on points table already) and update the Client.Points
field based in some
On 8/30/06, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote:
Hi list,I have a table like this:Points-Idoperationvalueand another two tables like thisClient Rule
-
On 8/28/06, Henry Ortega <[EMAIL PROTECTED]> wrote:
Here's what I am doing:I have this table:employee payrate effective tstamp end_date (to be updated by trigger)jdoe 1000 04-01-2006 2006-03-10 13:39:
07.614945jdoe
On Mon, Aug 28, 2006 at 11:53:36AM -0400, Henry Ortega wrote:
> CREATE FUNCTION updated_end_date() RETURNS trigger AS '
> BEGIN
>update table set end_date=(select effective-1 from table t2 where
> t2.employee=table.employee and t2.effective>table.effective order by
> t2.effective limit 1);
>
Here's what I am doing:I have this table:employee payrate effective tstamp end_date (to be updated by trigger)jdoe 1000 04-01-2006 2006-03-10 13:39:
07.614945jdoe 1500 04-01-2006 2006-03-12 15:
On Mon, Aug 28, 2006 at 10:02:32AM -0400, Henry Ortega wrote:
> I have a On Insert Trigger that updates one of the columns in that same
> table.
>
> Is there a way for the trigger to run only for the newly inserted records?
> Instead of all records in the database?
Row-level INSERT and UPDATE trig
On Fri, Aug 18, 2006 at 07:17:27PM +0200, Jacobo Garca wrote:
> I'm running a simple query inside a function that is associated with a
> trigger:
>
>SELECT tipo INTO tipocuenta FROM producto WHERE codigo_cuenta=
> NEW.codigo_destino;
>
> I am getting this error when running the code on pgadmi
On 7/13/06, Adrian Klaver <[EMAIL PROTECTED]> wrote:
For plpgsql use TG_OP. See link below.http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.htmlOn Thursday 13 July 2006 03:50 pm, Daniel Caune wrote:
> Hi, I've created a trigger BEFORE INSERT OR UPDATE on a table and, indeed,> when
For plpgsql use TG_OP. See link below.
http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html
On Thursday 13 July 2006 03:50 pm, Daniel Caune wrote:
> Hi,
>
>
>
> I've created a trigger BEFORE INSERT OR UPDATE on a table and, indeed,
> when the trigger is raised before insertion the re
On Wed, 12 Apr 2006, George Young wrote:
> [PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.1]
>
> I'm starting to use lots of foreign key constraints to keep my
> data clean. In one case, however, I need to allow null values
> for the key. E.g.:
>
> create table opset_steps
George Young wrote:
> Since foreign keys per se can't do this, I presume the way
> is to use triggers, though I have not used triggers before.
Says who? Just don't specify NOT NULL on the referencing column.
--
Alvaro Herrerahttp://www.CommandPrompt.com/
The Pos
Stephen,
You don't need to use a seperate batch to clean up the table. As
Stephan pointed out, you can call nextval after you determine that the
new row isn't a duplicate.
In case you misunderstood what Stephan had suggested let me try to
explain what is happening.
When PostgreSQL receives an IN
Hi, Stephen,
Foster, Stephen wrote:
> That's what I thought was going to be the answer. I was just hoping I
> was making a mistake somehow. It's no big deal but I like things
> organized and hate giant holes.
>
> Ok, one more thing for one of the batch jobs. No problem I have a
> cleanup routi
Lee Foster/
-Original Message-
From: Stephan Szabo [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 12, 2006 5:11 PM
To: Foster, Stephen
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Trigger/Sequence headache
On Sun, 12 Feb 2006, Foster, Stephen wrote:
> This is going to be one of those stupi
On Sun, 12 Feb 2006, Foster, Stephen wrote:
> This is going to be one of those stupid problems of mine. I have an
> insert trigger setup to verify that duplicate or repeating information
> isn't storage in the table. If trigger function finds the information
> as a duplicate it returns a NULL a
I do not know of a way to make your trigger run less often, but you could only
have it do the insert if something changes. This is what we do:
CREATE or replace FUNCTION UPDATE_SERVER_HST() RETURNS TRIGGER AS '
begin
if (OLD.ADD_DATE is distinct from NEW.ADD_DATE
or OLD.HOSTNAME
Josep Sanmartí wrote:
Hi,
readding around I just found this:
The CREATE TRIGGER statement in PostgreSQL implements a subset of the
SQL99 standard. (There are no provisions for triggers in SQL92.) The
following functionality IS MISSING:
* SQL99 allows triggers to fire on updates to specific col
Hi,
readding around I just found this:
The CREATE TRIGGER statement in PostgreSQL implements a subset of the
SQL99 standard. (There are no provisions for triggers in SQL92.) The
following functionality IS MISSING:
* SQL99 allows triggers to fire on updates to specific columns (e.g.,
AFTER UPDA
Hi Peter,
On Sun, 2005-11-20 at 12:08 +0100, Peter Eisentraut wrote:
> Joost Kraaijeveld wrote:
> > 1. Does an insert, update or delete statement return before or after
> > an "After" trigger (is such a trigger or rule synchronous or
> > a-synchronous?
>
> Synchronous
>
> > 2. Is there a concept
Joost Kraaijeveld wrote:
> 1. Does an insert, update or delete statement return before or after
> an "After" trigger (is such a trigger or rule synchronous or
> a-synchronous?
Synchronous
> 2. Is there a concept of a rule or trigger that fails?
> If so, if a trigger or rule fails, does the inser
On Mon, Aug 08, 2005 at 09:41:22PM +0300, Haris Saybasili wrote:
>
> I have two databasese: database1 and database2. I want to set a
> trigger on a table of database1 which will insert some values to a
> table of database2.
You could use contrib/dblink but you wouldn't have transaction
semantics.
On Tuesday 09 Aug 2005 12:11 am, Haris Saybasili wrote:
> Hi everybody,
>
> I have two databasese: database1 and database2. I want to set a
> trigger on a table of database1 which will insert some values to a
> table of database2.
>
> Is it possible with postgresql? How can I find detailed informat
On Tue, Aug 02, 2005 at 05:54:59PM -0700, Chris Travers wrote:
> >Hey, anyone know if it is possible to fire a trigger before a select?
> >I'm considering creating some tables which contain data summarized
> >from other tables as kind of a cache mechanism. The hope is I can
> >speed up some q
Kyle Bateman wrote:
Hey, anyone know if it is possible to fire a trigger before a select?
I'm considering creating some tables which contain data summarized
from other tables as kind of a cache mechanism. The hope is I can
speed up some queries that get executed a lot (and are kind of slow)
MAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Enrico Weigelt
Sent: Monday, May 02, 2005 9:02 AM
To: pgsql-sql
Subject: Re: [SQL] trigger/rule question
* Ramakrishnan Muralidharan <[EMAIL PROTECTED]> wrote:
Hi,
> Going through you mail, I assume that you are updating the mtime
>
Enrico Weigelt wrote:
>
> * Christoph Haller <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> > I assume this still refers to
> > [SQL] RULE for mtime recording
> > from last Friday.
>
> ehm, yeah. I forgot that I've already asked this stuff ...
> hmmpf. seems I'm not getting younger ;-)
>
>
> > I gave
* Christoph Haller <[EMAIL PROTECTED]> wrote:
Hi,
> I assume this still refers to
> [SQL] RULE for mtime recording
> from last Friday.
ehm, yeah. I forgot that I've already asked this stuff ...
hmmpf. seems I'm not getting younger ;-)
> I gave it another thought and
> I am now having somet
* Ramakrishnan Muralidharan <[EMAIL PROTECTED]> wrote:
Hi,
> Going through you mail, I assume that you are updating the mtime
> only after inserting the record.
An "normal" update (=done by an application or user) should also
update the mtime. But there's an replication subsystem, whi
Hi,
Going through you mail, I assume that you are updating the mtime only after
inserting the record. It is always possible to check the mtime filed value of
the inserted record and take action based on it in the trigger.
Is it possible to send me detail about the trigger?
Regards,
R.
Enrico Weigelt wrote:
>
> Hi folks,
>
> for database synchronization I'm maintaining an mtime field in
> each record and I'd like to get it updated automatically on
> normal writes (insert seems trivial, but update not), but it
> must remain untouched when data is coming in from another node
> (t
[EMAIL PROTECTED] wrote:
CREATE TRIGGER products_codes_checkfieldvalue BEFORE INSERT OR UPDATE ON
main.products_codes FOR EACH ROW EXECUTE PROCEDURE
trigger_system_checkfieldvalue('main','products_codes');
--- ERROR: function trigger_system_checkfieldvalue() does not exist
But the functio
It requires a bit more work in PostgreSQL to create a trigger.
From the documentation: "It is not currently possible to write a
SQL-language trigger function. Trigger functions can be written in C or
in some of the available procedural languages."
I guess you will prefer to write the trigger in
OW
EXECUTE PROCEDURE synchronize();
Best Regards
Eugen
-Ursprüngliche Nachricht-
Von: Pavel Rabel [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 16. Februar 2005 21:43
An: Eugen Gass
Cc: pgsql-sql@postgresql.org
Betreff: Re: [SQL] Trigger
It requires a bit more work in PostgreSQL to create
On Wed, Feb 16, 2005 at 02:44:30PM +0100, Eugen Gass wrote:
>
> I'm trying to create a trigger on PostgreSQL
See the "Server Programming" part of the documentation (substitute
the appropriate version of PostgreSQL in the links):
http://www.postgresql.org/docs/8.0/static/server-programming.html
h
On Wed, Nov 03, 2004 at 08:57:35AM -0600, hook wrote:
> What's the easy way to tell if a trigger has fired???
Tell from where? You could log messages from the trigger (e.g.,
with RAISE INFO in PL/pgSQL), but that might not be what you're
talking about.
What are you trying to do?
--
Michael Fu
You need to define fn_foo w/o params per Doc Section 19.9.
Your intent as expressed in the trigger def (args) can then be fulfilled
through special top level vars.
On Mon, 2004-08-02 at 16:20, Jeff Boes wrote:
> Hmm, this is puzzling me:
>
> create or replace function fn_foo(text) returns trigger
On Mon, Aug 02, 2004 at 04:20:15PM -0400, Jeff Boes wrote:
> It would seem my trigger definition is trying to find fn_foo(), when I
> mean for it to call fn_foo(TEXT).
Triggers have to be declared to take no arguments; they find the rows on
which they operate in magical ways. (For PL/PgSQL trigg
On Mon, 2 Aug 2004, Jeff Boes wrote:
> Hmm, this is puzzling me:
>
> create or replace function fn_foo(text) returns trigger as '
> begin
># Do some stuff with $1
> end;
> ' language 'plpgsql';
>
> CREATE FUNCTION
>
> create table bar (aaa text);
>
> CREATE TABLE
>
> create trigger trg_bar
> a
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi!
I have solved the problem!
Tom Lane wrote:
> Andreas Haumer <[EMAIL PROTECTED]> writes:
>
>>I just can't figure out where and how many quotation marks
>>I have to place in my function.
>
>
> It's messy all right. The "dollar quoting" feature in
Andreas Haumer <[EMAIL PROTECTED]> writes:
> I just can't figure out where and how many quotation marks
> I have to place in my function.
It's messy all right. The "dollar quoting" feature in 7.5 should make
it a lot less painful, since you can stop having to double and re-double
quote marks. If
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi!
Many thanks for your reply!
Tom Lane wrote:
> Andreas Haumer <[EMAIL PROTECTED]> writes:
>
>>It seems I would have to use EXECUTE on dynamically constructed
>>PL/PGSQL statements in order to have my trigger function recognize
>>the parameters giv
Andreas Haumer <[EMAIL PROTECTED]> writes:
> It seems I would have to use EXECUTE on dynamically constructed
> PL/PGSQL statements in order to have my trigger function recognize
> the parameters given to the trigger in TG_ARGV[]
Yup, that's exactly right. plpgsql isn't designed for this; it's
des
On 6/8/2004 2:57 PM, Mike Rylander wrote:
kasper wrote:
Hi guys
Im tryint to make a trigger that marks a tuble as changed whenever someone
has updated it
my table looks something like this
create table myTable (
...
changed boolean;
)
now ive been working on a trigger and a sp that looks li
On Tue, 8 Jun 2004, kasper wrote:
> Im tryint to make a trigger that marks a tuble as changed whenever someone
> has updated it
>
> my table looks something like this
>
> create table myTable (
> ...
> changed boolean;
> )
>
> now ive been working on a trigger and a sp that looks like thi
kasper wrote:
> Hi guys
>
> Im tryint to make a trigger that marks a tuble as changed whenever someone
> has updated it
>
> my table looks something like this
>
> create table myTable (
> ...
> changed boolean;
> )
>
> now ive been working on a trigger and a sp that looks like this, bu
hook <[EMAIL PROTECTED]> writes:
> What's the proper way to include the suport files for building 'C' trigger
> functions in to the normal PostgreSQL install?
>
>
> I.E. /
> "make install "does not include internal/postgres_fe.h, executor/spi.h
> nor commands/trigger.h in to /usr/local/pgsql
1 - 100 of 166 matches
Mail list logo