Hi all,
is there a way (also strange) to define a trigger on a system table (for
example on pg_class)?
I tried but I got (as expected) a permission denied message...
Thanks
Gianvito Pio pio.gianv...@gmail.com 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.
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:
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 adjust the order triggers are fired?
Regards
mk
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
table. Is
--- 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
function
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
function replicate ( ) , inside the function definition
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 appropriate
Hi list,
I am planning to generate a trigger to each [update or delete or insert] on my database to register all moviment on my base (current_user, when, action, user).
I notice that the trigger is able put a procedure in action but as I have more than 20 tables I would like to use only one
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
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
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 know
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
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 (may be
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).
- Original Message -
From: Aaron Bono
To: John DeSoi
snip
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
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). Though I have done similar things in other
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 separate
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] wrote:
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 also
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
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 'persons' table whenever I do an insert or
update into my
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
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 about the
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 έγραψε στις Nov
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 understand triggers.
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 OR
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
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_date', and
'property_id'.
I have written a trigger that is fired on inserts and updates for both
tables that
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
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 seem to
Hi,
If you are moving from Postgres to MS SQL you will most likely will find
that you can not recreate your PostgreSQL FK to MSSQL FK because this
enterprise class database will NOT allow you to create all 3 FK which are
exist in your PGSQL:
table users(user_id PK)
table journal(created_by,
update trigger working on same table???
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
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:
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
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 excellent time to
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 row
being inserted/updated using NEW like this
CREATE FUNCTION
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
Hi!
I am having a probably stupid question, but anyway I can't find it's
solution. it should be a novice question, but lets see :))
I have 2 tables.
calendar:
person_id INTEGER
when DATE
type TEXT
holiday:
person_id INTEGER
assigned_to DATE
last_possible_assignment DATE
the idea
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 the
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
i do it on
-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
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 Function, as follows :
CREATE
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
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
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?
Uzo
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send
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
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
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
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 any Table of the Real
[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
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 that
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 there
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.
- Richard
--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 all this,
--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 do so. If it's not
Hi
I want to do a generic function that I can add to triggers to add every
inserts, updates and deletes from many differents tables into a common
format in another table. the idea is :
create function do_it_all () returns opaque '
begin
IF TG_OP = ''INSERT'' THEN
cycle through all of NEW
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.
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 system,
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
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,
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
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
Hallo!
I have written a very small test procedure to show a possible error
on PostgreSQL V7.1.1.
A trigger does not fire the function on update but on inserts.
Does someone have made the same experiences?
Here is the short example which is doing nothing important, just showing
the
situation:
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
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 fire the
Well, after dinking around for serveral hours I decided to beg for help
on here about triggers and look like an idiot all in one slew.
I have two tables. A and B. Whenever A has a row inserted I want to
grab that newly created primary key from it's row in table A and insert
it into a field in
Hello All,
I have been reading on the uses of the Triggers from within the PL/pgSQL
language and have seen that you can set up triggers for such things as UPDATE,
and INSERT.
I was just wondering why there was no trigger mechanicism for the SELECT
statement?
I could find some possible uses for
68 matches
Mail list logo