473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Triggers in PostgreSQL

I have read few topics on Triggers..

I was just wondering if it is possible to have a parameter to a function from the external environment..

I mean...
I am into PHP and PostgreSQL and we want to integrate logs in our system, to keep track of the operations for each and every user. So, is it possible to acquire the user's id and use it in a function???
Feb 3 '09 #1
1 3266
rski
700 Expert 512MB
You can define function arguments while creating trigger (no while creating function). You can use arguments value via TG_ARG[] table.
For more see here http://www.postgresql.org/docs/8.1/i...l-trigger.html
Feb 3 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andreas Forsgren | last post by:
Hi gurus, Anyone knows how to solve this? I was playing around with triggers on my own machine which runs 7.3 and there it works okey, but when trying it on 7.2 I get an error about duplicate...
1
by: Nagib Abi Fadel | last post by:
Hi, is there any good trigger tutorial on the net ?? thx __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com
1
by: Ling Xiaoyu | last post by:
Hello there. Can anybody help me with Postgresql triggers? what I need is a trigger which update value of field "tables_rows.total_rows" to rows count of table "zzz" if I insert new row in table...
6
by: Antonios Christofides | last post by:
Hi, I've prepared a test case about this, which I include below. I have tables "a" and "b"; "b" has a foreign key to "a", on delete cascade. In addition, there is a "before delete on b" trigger,...
2
by: Karl O. Pinc | last post by:
Hi, I don't suppose that the todo item: Referential Integrity o Add deferred trigger queue file (Jan) Means that there will be a statement like: CREATE TRIGGER ... FOR EACH TRANSACTION
1
by: Christoph Graf | last post by:
Hi everybody! As far as I have seen you can inherit from a table and get its columns. Is there a possibility to also inherit a tables triggers? When I simply derive a table from another I...
4
by: rama | last post by:
Hi, I am a bit troubled with the row-level triggers which PostgreSQL uses when using update table cpmmand. For instance, if the primary key column has values 1,2,3,... and i want to update the...
1
by: SVGK, Raju | last post by:
Hi, I have a table where in lot of triggers were included in that as shown below. How to view/access triggers and procedures from postgresql. I am using postgresql 7.4.1 on solaris. regds...
0
by: Bruno Lavoie | last post by:
Hello, i'm etablishing a naming convention for a new project under postgresql. For tables, sequences, views, that's ok! I used good naming conventions for this in the past and i'll keep these...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.