All Questions
Tagged with postgresql-9.1 trigger
8 questions
2
votes
1
answer
66
views
Postgres Trigger function - Pg 9.1
There is a table on my database that stores a path for video files used by my website. Those files are stored in a SSD disk.
path character varying(255)
id serial
The path will always be like this:
/...
1
vote
1
answer
184
views
Trigger for removing group with no users left in
I have three tables: USERS, GROUPS, and GROUP_MEMBERSHIP
CREATE TABLE USERS (
ID BIGSERIAL NOT NULL,
NICKNAME VARCHAR(20) NOT NULL constraint USER_EXISTS UNIQUE,
PRIMARY KEY (ID)
);
CREATE TABLE ...
5
votes
1
answer
333
views
Trigger function using current row and current table name as variables (final part)
Like detailed in my first question I have a Postgres 9.1 database with multiple tables that have the exact same column names, they only vary in their column values:
tbl_log_a
tbl_log_b
tbl_log_c
...
...
1
vote
1
answer
2k
views
Trigger function using current row and current table name as variables
Like detailed in my first question I have multiple tables with identical layout in a Postgres 9.1 DB.
They only vary in their column values:
tbl_log_a
tbl_log_b
tbl_log_c
...
26 tables (from a to z). ...
2
votes
1
answer
1k
views
trigger can't access column loop
SSCCE:
The following script:
$ cat test.sql
CREATE TABLE public.foo (
loop INTEGER
);
CREATE OR REPLACE FUNCTION public.foo_fun(loop INTEGER) RETURNS BOOLEAN AS $$
SELECT TRUE;
$$ LANGUAGE SQL;
...
1
vote
0
answers
628
views
Storing changes to stored procedure and triggers in PostgreSQL
I want a mechanism where I can store/track changes in stored procedure and triggers.
I want to track these logs in some table. What is the best possible way ?
1
vote
1
answer
3k
views
Passing argument in trigger dynamically
CREATE TRIGGER audit_proc_tr
AFTER INSERT OR UPDATE OR DELETE
ON "log".hi
FOR EACH ROW
EXECUTE PROCEDURE "log".audit_proc(argument);
CREATE OR REPLACE FUNCTION fn_configpurchaseorder(...
9
votes
1
answer
28k
views
one trigger for multiple tables
i have a trigger in PostgreSql 9.1 that i want to fire on inserts of several tables. is it possible to have it affect all these tables instead of creating the trigger for all these tables?
i have 58 ...