Gianvito Pio wrote:
> Hi all,
> is there a way (also strange) to define a trigger on a system table (for
> example on pg_class)?
No.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If
Thanks for a fast answer. Frankly I was hoping it would be alphabetical ;)
regards
mk
2008/4/18, A. Kretschmer <[EMAIL PROTECTED]>:
>
> am Fri, dem 18.04.2008, um 11:44:12 +0200 mailte Marcin Krawczyk
> folgendes:
>
> > Hi all. Today my question is about the order triggers are fired on a
> tabl
am Fri, dem 18.04.2008, um 11:44:12 +0200 mailte Marcin Krawczyk folgendes:
> Hi all. Today my question is about the order triggers are fired on a table. Is
> there a way to determine that order? Or what interests me even more, can I
alphabetical.
Andreas
--
Andreas Kretschmer
Kontakt: Heynit
--- ashok raj <[EMAIL PROTECTED]> wrote:
> Hello All ,
>
>I am having a table named "test" with a trigger " tri_test
> " which triggers the function " replicate() " on insert, update and
> delete .
>Can I able to get the SQL STATEMENT which triggers the
Hi,
Plesae read my previous message in this mail list,
on 2006-08-15. 14.20 at " [SQL] Undo an update" thread.
bye,
kjt
McAfee SCM 4.1 által ellenőrizve!
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriat
Hi,
You can use one procedure(function in Postgres) but you have to use 26
triggers.
Every trigger can call this one procedure to record the information you
want.
Regards,
Kaloyan Iliev
Ezequias Rodrigues da Rocha wrote:
Hi list,
I am planning to generate a trigger to each [update or de
- Original Message -
From: Aaron Bono
To: John DeSoi
I don't think so but there was some discussion a week or two ago about
mixing variables and using execute. I am curious, does anyone >know what
the "best" approach is?
Also, I did not address deletions. If you still need to d
Thusitha Kodikara написа:
> Hello,
>
> I am interested in developing some triggers to keep track of records that are
> changed (possibly the changes of one or more specific columns). In addition
> to keeping the new values, I also need to keep the old values (may be on a
> separate table).
>
On Sun, 2006-07-30 at 21:16 -0700, Thusitha Kodikara wrote:
> Hello,
>
> I am interested in developing some triggers to keep track of records
> that are changed (possibly the changes of one or more specific
> columns). In addition to keeping the new values, I also need to keep
> the old values (ma
On Jul 31, 2006, at 10:59 AM, Aaron Bono wrote:
On 7/31/06, John DeSoi <[EMAIL PROTECTED]> wrote:
Is it really necessary to build a SQL string and use execute? It
seems you could just issue the INSERT statement.
I don't think so but there was some discussion a week or two ago
about mixing va
On 7/31/06, John DeSoi <[EMAIL PROTECTED]> wrote:
Is it really necessary to build a SQL string and use execute? Itseems you could just issue the INSERT statement.I don't think so but there was some discussion a week or two ago about mixing variables and using execute. I am curious, does anyone kno
Is it really necessary to build a SQL string and use execute? It
seems you could just issue the INSERT statement.
On Jul 31, 2006, at 12:52 AM, Aaron Bono wrote:
CREATE OR REPLACE FUNCTION my_table_history_fn () RETURNS SETOF
opaque AS
'
BEGIN
-- if a trigger insert or update operation
No problem. I have been meaning to put the same code together for
myself but have been putting it off. It gave me an excuse to stop
procrastinating.On 7/31/06, Thusitha Kodikara <[EMAIL PROTECTED]> wrote:
Hello,Thanks a lot Aaron for the very quick and simple example. I just checked it on 7.4.5 a
Hello,Thanks a lot Aaron for the very quick and simple example. I just checked it on 7.4.5 also and it worked. I'll be able to continue with my development using the syntax of that example.Regards,-ThusithaAaron Bono <[EMAIL PROTECTED]> wrote: On 7/30/06, Thusitha Kodikara <[EMAIL PROTECTED]> wrot
On 7/30/06, Thusitha Kodikara <[EMAIL PROTECTED]> wrote:
Hello,I am interested in developing some triggers to keep track of records that are changed (possibly the changes of one or more specific columns). In addition to keeping the new values, I also need to keep the old values (may be on a separat
On 11/23/2005 3:44 AM, Achilleus Mantzios wrote:
O Neil Saunders έγραψε στις Nov 22, 2005 :
And change AFER INSERT to BEFORE INSERT
1) it doesnt make any difference since we are updating
a different table than the trigger's one
In this particular case it doesn't. In general, another BEFOR
O Neil Saunders έγραψε στις Nov 22, 2005 :
> And change AFER INSERT to BEFORE INSERT
1) it doesnt make any difference since we are updating
a different table than the trigger's one
2) Your email text comes really garbled
>
--
-Achilleus
---(end of broadcast)
On Tuesday 22 November 2005 18:07, Achilleus Mantzios wrote:
>O Leif B. Kristensen ?? Nov 22, 2005 :
>> What am I missing?
>
>apparently some forgotten process_last_edited() function.
Yes -- an earlier attempt at the same thing ...
I finally managed to create my first trigger:
CREATE O
And change AFER INSERT to BEFORE INSERT
On 11/22/05, Achilleus Mantzios <[EMAIL PROTECTED]> wrote:
> O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
>
> > On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
> > >O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> > >> I'm trying to understa
Try:
create or replace function update_last_edit() returns trigger as
$$
begin
new.last_edit=now();
return new;
end;
$$ language plpgsql;
On 11/22/05, Leif B. Kristensen <[EMAIL PROTECTED]> wrote:
> On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
> >O Leif B. Kristensen έγραψε στις N
O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
> >O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> >> I'm trying to understand triggers. I have read the documentation in
> >> the manual as well as the few pages in the Douglas book ab
On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
>O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
>> I'm trying to understand triggers. I have read the documentation in
>> the manual as well as the few pages in the Douglas book about the
>> subject, but I don't see how to implement a tr
O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> I'm trying to understand triggers. I have read the documentation in the
> manual as well as the few pages in the Douglas book about the subject,
> but I don't see how to implement a trigger that simply updates a
> 'last_edit' date field in my 'p
Neil Saunders <[EMAIL PROTECTED]> writes:
> I've tried to write something along the lines of the following:
> sdate = (NEW.start_date IS NOT NULL) ? NEW.start_date : OLD.start_date;
> edate = (NEW.end_date IS NOT NULL) ? NEW.end_date : OLD.end_date;
> But conditional assignment doesn't se
coalesce(NEW.end_date , OLD.end_date) will solve the issue.On 9/15/05, Neil Saunders <[EMAIL PROTECTED]
> wrote:Hi,I've run in to a small problem when writing a trigger.
For simplicities sake lets say that I have 2 tables – 'bookings' and'unavailable_periods'. Both have columns 'start_date','end_da
update trigger working on same table???
If an UPDATE trigger does an update on its own table, it can trigger
itself and explode...
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomai
On Mon, Feb 14, 2005 at 05:42:27PM +0200, ALÝ ÇELÝK wrote:
>
> update trigger working on same table???
Could you be more specific, please? What are you trying to do?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
---(end of broadcast)---
TIP 8: ex
"Richard Huxton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Pradeepkumar, Pyatalo (IE10) wrote:
> > IF UPDATE(CreateTime) THEN
> >
> >
> > END IF;
> >
> > Is this syntax correct.
>
> No, and I don't recall seeing anything like it in the manuals.
... and it's always an
I'd like to add that a NULL value might mess things up. If CreateTime may be
null, try this:
if (OLD.CreateTime <> NEW.CreateTime) OR
(OLD.CreateTime ISNULL <> NEW.CreateTime ISNULL) THEN ...
or this:
if COALESCE(OLD.CreateTime, '3001-01-01') <>
COALESCE(NEW.CreateTime, '3001-01-01
Pradeepkumar, Pyatalo (IE10) wrote:
Thanks a lot for ur help.
In the trigger, I am checking if a field is updated or not. The syntax I
use is
IF UPDATE(CreateTime) THEN
END IF;
Is this syntax correct.
No, and I don't recall seeing anything like it in the manuals.
IF OLD
, 2004 12:50 PM
To: Pradeepkumar, Pyatalo (IE10)
Cc: [EMAIL PROTECTED]
Subject: Re: [SQL] Triggers - need help !!!
On 2004-07-07 08:45, UÅytkownik Pradeepkumar, Pyatalo (IE10) napisaÅ:
> Hi,
>
> I am writing some triggers for my project.
> I am writing a trigger on a table after delete.
On 2004-07-07 08:45, UÅytkownik Pradeepkumar, Pyatalo (IE10) napisaÅ:
Hi,
I am writing some triggers for my project.
I am writing a trigger on a table after deleteI want to know how u refer
to the row that is being deleted.
For example for a trigger function after INSERT/UPDATE u refer to the r
Philip J. Boonzaaier wrote:
The technical reference gives an example of a trigger on a table - employee
Just to test this, I have created the following table,
CREATE TABLE employee
(name VARCHAR(30),
age int4,
state VARCHAR(2),
manager VARCHAR(3),
adult VARCHAR(3));
The I created a simple Functio
On Fri, 19 Mar 2004 10:13:56 -0500
Tom Lane <[EMAIL PROTECTED]> wrote:
> Erik Thiele <[EMAIL PROTECTED]> writes:
> > now. what i wanted to do is ensure that this is done correctly and
> > otherwise abort the transaction.
> > of course this check needs to be done at the commit time, because if
> >
Erik Thiele <[EMAIL PROTECTED]> writes:
> now. what i wanted to do is ensure that this is done correctly and
> otherwise abort the transaction.
> of course this check needs to be done at the commit time, because if i
> do it on statement level, it cannot work, since i cannot change two
> tables at
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thursday 26 February 2004 2:18 am, Philip J. Boonzaaier wrote:
> The technical reference gives an example of a trigger on a table -
> employee Just to test this, I have created the following table,
> CREATE TABLE employee
> (name VARCHAR(30),
> age
I try pgmail and that is well running ...
fo security, do not use attachment files with your mail ...
try pgmail, you need to use pl/tclu ...
Ben
Sai Hertz And Control Systems wrote:
Dear Uzo ,
Hi,
does postgresql support the ability to email as in SQL Server? I want
to create a trigger which
I
try pgmail and that is well running ...
fo security, do not use attachment files with your mail ...
try pgmail, you need to use pl/tclu ...
Ben
Sai Hertz And Control Systems wrote:
Dear
Uzo ,
Hi,
does postgresql support the ability to email as in SQL Server? I want
to cr
On Monday 12 January 2004 16:14, beyaRecords - The home Urban music wrote:
> Hi,
> does postgresql support the ability to email as in SQL Server? I want
> to create a trigger which on input of a record will send out an email.
> Is this possible?
Have a look in the mailing list archives - this has
Dear Uzo ,
Hi,
does postgresql support the ability to email as in SQL Server? I want
to create a trigger which on input of a record will send out an email.
Is this possible?
http://pgmail.sourceforge.net/ is what you need.
Regards,
Vishal Kashyap
---(end of broadcast)
beyaRecords - The home Urban music wrote:
> does postgresql support the ability to email as in SQL Server? I want
> to create a trigger which on input of a record will send out an
> email. Is this possible?
Write a trigger function in, say, PL/PerlU or PL/sh and have it send the
email with the us
[EMAIL PROTECTED] wrote:
Hi,
I have two databases with the same tables, one is my Real Database and the other is my
Log Database.
My Log database does NOT have any kind of keys (PRIMARY or FOREIGN).
I need to insert from my Real database to my Log database every row that is Updated or Deleted in
Stian Riis wrote:
> Hi.
>
> Does anyone know if it is posible to make a trigger that execute an
> external program ? I want to execute a another program on the server
> when I get a row in one of my tables...
Yes, you can use plperl and call an external program from there, or us
plsh and run it t
On Fri, 11 Oct 2002, Richard Huxton wrote:
>
> The customary way is to have a "helper" process that sits there LISTENing for
> a NOTICE and then calls the external program as required. Cleaner and means
> the other program doesn't have any direct connection to the Postgresql
> backend.
>
> - Rich
On Friday 11 Oct 2002 2:48 pm, Stian Riis wrote:
> Hi.
>
> Does anyone know if it is posible to make a trigger that execute an
> external program ? I want to execute a another program on the server
> when I get a row in one of my tables...
The customary way is to have a "helper" process that sits
--On mercredi 28 août 2002 08:42 +0200 Mathieu Arnold <[EMAIL PROTECTED]> wrote:
>
>
> --On mardi 27 août 2002 15:38 -0700 Josh Berkus <[EMAIL PROTECTED]> wrote:
>
>>
>> Mathieu,
>>
>>> The thing I need, is to be able to know what does NEW contains, and I
>>> have not found out any mean to
--On mardi 27 août 2002 15:38 -0700 Josh Berkus <[EMAIL PROTECTED]> wrote:
>
> Mathieu,
>
>> The thing I need, is to be able to know what does NEW contains, and I
>> have not found out any mean to do so. If it's not possible to do so,
>> I'll write a function per table, but for the beauty of
Mathieu,
> The thing I need, is to be able to know what does NEW contains, and I have
> not found out any mean to do so. If it's not possible to do so, I'll write
> a function per table, but for the beauty of all this, I would have liked to
> do it the way above.
You can't do this in PL/pgSQL.
On Sat, 3 Aug 2002, Marc SCHAEFER wrote:
> is there any replacement so that inserting somewhere acts on multiple
> tables ?
Thanks for the suggestion to use RULES.
My solution (comments welcome):
DROP RULE r_entree_rapide_ecriture_insert;
DROP FUNCTION f_entree_rapide_ecriture_insert(TEXT,
Marc SCHAEFER <[EMAIL PROTECTED]> writes:
> at least with PostgreSQL 7.1 it was possible to create a trigger on a
> view.
Use a rule instead. 7.2 will reject an attempt to insert into a view
without a replacement rule, so a trigger would do you no good anyhow.
(I thought that behavior went back
Marc,
> at least with PostgreSQL 7.1 it was possible to create a trigger on a
> view. 7.2 seems to fail with:
>
>psql:t:25: ERROR: CreateTrigger: relation "egg_view" is not a
> table
>
> is there any replacement so that inserting somewhere acts on multiple
> tables ?
Yes. Use the RULES s
I can vouch for that. I have several tables with 10
to 16 million entries in much the same sort of setup
as you are describing (primary key, timestamp, value).
PostgreSQL is will quite happily use the timestamp
indexes when accessing this table, and it doesn't
default to a sequential scan until
Hello Tom!
Thank you for your help!
Your hints did solve the asked problem.
The update trigger is fired if there is a row in the table test to be
updated.
But, behind my question there was another design (philosophie) which I
am trying to
solve by the means of different triggers.
This is off
Reiner Dassing <[EMAIL PROTECTED]> writes:
> I have a table which has a lot of entries (some x millions) of the kind
> (id, timestamp, value)
> The access (selects) is concentrated to the timely last some thousands
> entries.
> To adapt this fact I want to setup a "virtual" table - test in my
> e
Your update trigger is fired FOR EACH ROW and no rows are updated i.e. no trigger
fired!
On Tue, 16 Oct 2001 14:48:59 +0200, Reiner Dassing <[EMAIL PROTECTED]> wrote:
> Hallo!
>
> I have written a very small test procedure to show a possible error
> on PostgreSQL V7.1.1.
> A trigger does not fi
Reiner Dassing <[EMAIL PROTECTED]> writes:
> I have written a very small test procedure to show a possible error
> on PostgreSQL V7.1.1.
The error is yours: you set up the trigger function to return NULL,
which means it's telling the system not to allow the INSERT or UPDATE.
> INSERT INTO test V
> The result is as follows:
> INSERT INTO test VALUES(1,'2000-10-11 12:00:00',-20.2);
> NOTICE: Fired INSERT
> INSERT 0 0
> UPDATE test SET value = 1000.0 WHERE epoch = '2000-10-11 12:10:00' AND
> sensor_id = 1;
> UPDATE 0
>
> The insert notice can be shown!
> The update notice is not there!
>
57 matches
Mail list logo