Hi,
Just doing some testing at the moment and trying to make a trigger that
consists of a insert statement which as a result of an sql querty!
Is this possible? if so could someone give me some pointers as i am
having no luck trying to get this to work, have even tried this but
still doesnt wor
Hello, I have this doubt since I started using PostgreSQL, a few months ago.Why triggers are defined that way? I mean, in others DBMS you simply write:CREATE TRIGGER ... bla bla bla
BEGIN END;Why you should write a function first and then the trigger, which must call that function?What are th
Gente, buenos dias.
Como consulto lo triggers desde psql?
Gracias!
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi, all!
I am trying to create a trigger to update a field on a "son" table
when a linked field (foreign key) is modified on a table "father".
example:
table son: table father:
-
id /-< id
description
Hello,
I have postgresql 6.4.2 on bsdi3.1
here is one problem with triggers:
ser=> select updater();
updater
---
t
(1 row)
ser=> \df updater
result|function|arguments|description
--++-+---
bool |updater | |
(1 row)
ser=> CREATE TRIGGER daemon_singleton B
Hi,
it is very inconvenient for me that triggers aren't inherited:
create table watch (
mod timestamp with time zone default '-infinity' not null
);
create function update_mod() returns trigger ...
create trigger update_mod before insert or update on watch
for each row e
hello,
consider a sample table:
create table item (id serial, parent_id int, path varchar(256));
"id" is a unique identifier of each row,
"parent_id" is an id of another row in the same table or null
what is the right way in postgresql to ensure that the "path" field of
a given row is a prefix
Triggers have never been inherited, right? Not in any version?
I'm pretty sure that's the case, but I'm debugging some old logging and just
need to confirm it.
--
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice
---(end of broadcast)---
Jamie Deppeler wrote:
Hi,
Just doing some testing at the moment and trying to make a trigger that
consists of a insert statement which as a result of an sql querty!
Look into using EXECUTE - it accepts a string expression and executes
it. Don't forget to use the quote_xxx() functions to quote ide
Hello,
I have asked about this before, but I just haven't been able to get
anywhere with it yet.. I'm hoping someone can help me?
Here is my original function and trigger:
CREATE OR REPLACE VIEW items_category AS select count(*) AS count
,b.category,nlevel(b.category) AS level,
subpath(b.cate
> Why you should write a function first and then the trigger, which must
> call that function?
>
> What are the advantages/disadvantages of that? Where can I find more
> information?
The PG way seems very natural to me:
you can write functions that do something and then have many triggers
call t
Chris Mair <[EMAIL PROTECTED]> writes:
>> Why you should write a function first and then the trigger, which must
>> call that function?
> ... there's not just PL/PGSQL: you might want
> to define a function in C or Perl and then have a trigger call it.
Right, that's the real reason: this approach
Hi All!I want to setup a trigger capable to return more than one record.Example (table users contains 10 records):CREATE FUNCTION get_users() RETURNS SOME_TYPE AS 'BEGIN return (SELECT * FROM users);' LANGUAGE 'plpgsql';I can't figure out the correct Postgres type for SOME_TYPE (see above
Hello Gustavo !
> Gente, buenos dias.
> Como consulto lo triggers desde psql?
>
Unfortunately I don't know Spanish. As far as I understand your
question was about triggers in postgresql. Trigger is the function
calls automatically on operations insert-delete-update.
--
Best regards,
Sincerely y
Hi,
I'm porting a database from Oracle, and I'm having difficulty
working out the syntax & logic for porting the triggers.
Here's an example of what I have in Oracle:
create table Images (
id varchar(100) PRIMARY KEY,
title varchar(25)NOT NULL,
filepath va
On Fri, 22 Sep 2000, Enrico Comini wrote:
> Question
> If have a table with a primary key and another table with outer key
> referenced on the primary of the first table.
> If I want list the active triggers how i have to do ?
select * from pg_trigger;
> If I delete de first table I have the m
1) I have some TRIGGER BEFORE INSERT created explicitly, and other(s)
created implicitly, through default constraints. What is their execution
order?
2) Are the changes made by the first visible to the following ones?
---(end of broadcast)---
TIP 5
> I started looking at the trigger support in PostgreSQL and found what I
> needed except I'm not sure how to write the "body" of the trigger. In
> Oracle I write PL/SQL but it seems I may have to write C code on the
> PostgreSQL side. Is this true? Is there a PostgreSQL procedural language
> t
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
---(end of broadcast)---
TIP 9: the planner will ignore you
First, thank you for your answers about my problem with the function
'CREATE TRIGGER',
I have another question about triggers, how can I pass arguments ?? I
read about some struct TriggerData *CurrentTriggerData, but I didn't
found any explanation or example about how to use it in postgres SQL.
Bertram Scharpf wrote:
Hi,
it is very inconvenient for me that triggers aren't inherited:
Foreign keys too (which are a special type of trigger of course).
Is this behaviour to be implemented at any point of time in
the future? Could it be advisible to write the patch? Or is
it just too easy
Hi -
I too have encountered this issue. The work around that I created was to
have every table have a set of 3 cooresponding functions that know how to
1) create the table; 2) create triggers for the table; 3) create indexes
for the table. By doing so, I then am able to use a lazy partitioning
Hi,
Am Freitag, 23. Feb 2007, 07:10:06 + schrieb Richard Huxton:
> Bertram Scharpf wrote:
> >it is very inconvenient for me that triggers aren't inherited:
>
> Foreign keys too (which are a special type of trigger of course).
>
> >Is this behaviour to be implemented at any point of time in
>
I believe you have a design problem. It seems to me that you need two tables;
one with (id, path) and the other with (parent_id, path). Then you can use an
UPDATE trigger on item which checks for a change in path. If it has changed,
then you can update all those records in table "item2" where it
Hi, List!
Are there any plans to realize triggers on SELECT in new versions of PG?
Sergey Karin
Scott Ribe <[EMAIL PROTECTED]> writes:
> Triggers have never been inherited, right? Not in any version?
AFAIR, no. If they had been I kinda doubt we would have removed it.
regards, tom lane
---(end of broadcast)---
TIP 4: H
Hi.
I want to use a table
CREATE TABLE stats (
upd TIMESTAMP,
crt TIMESTAMP DEFAULT NOW()
);
with inheritance
CREATE sometable (
)
INHERITS stats
to automatically maintain update dates. However the obviuos trigger
CREATE OR REPLACE
FUNCTION stat_upd()
RETURNS TRIGGER
AS '
BEGIN
Greg wrote:
> is "DROP TRIGGER" transaction safe?... I mean, could I do:
>
> BEGIN
> DROP TRIGGER category_mv_ut;
> ... insert rows
> ... update materialized view table
> CREATE TRIGGER category_mv_ut AFTER UPDATE ON items
> FOR EACH ROW EXECUTE PROCEDURE update_ut();
> COMMIT;
>
> .. without oth
>Greg wrote:
> > is "DROP TRIGGER" transaction safe?... I mean, could I do:
> >
> > BEGIN
> > DROP TRIGGER category_mv_ut;
> > ... insert rows
> > ... update materialized view table
> > CREATE TRIGGER category_mv_ut AFTER UPDATE ON items
> > FOR EACH ROW EXECUTE PROCEDURE update_ut();
> > COMMIT;
Greg asked:
> > is "DROP TRIGGER" transaction safe?... I mean, could I do:
> >
> > BEGIN
> > DROP TRIGGER category_mv_ut;
> > ... insert rows
> > ... update materialized view table
> > CREATE TRIGGER category_mv_ut AFTER UPDATE ON items
> > FOR EACH ROW EXECUTE PROCEDURE update_ut();
> > COMMIT;
Phil Endecott <[EMAIL PROTECTED]> writes:
> It seems less scary when you think of metadata as just being the content
> of more tables, rather than something special.
PG does just fine with handling metadata changes transactionally.
However, most operations that affect a table's schema at all will
Tom Lane wrote:
Phil Endecott <[EMAIL PROTECTED]> writes:
It seems less scary when you think of metadata as just being the content
of more tables, rather than something special.
PG does just fine with handling metadata changes transactionally.
However, most operations that affect a table's schema
Phil Endecott <[EMAIL PROTECTED]> writes:
> I would understand this if I were doing an "ALTER TABLE", for example.
> But does adding or removing a trigger really count as "schema-altering"?
[ shrug... ] Hard to say. Probably depends a lot on what the trigger
does. I suppose we could at least
> Phil Endecott <[EMAIL PROTECTED]> writes:
>> I would understand this if I were doing an "ALTER TABLE", for example.
>> But does adding or removing a trigger really count as "schema-altering"?
>
> [ shrug... ] Hard to say. Probably depends a lot on what the trigger
> does. I suppose we could
Hi,
I'm running PostgreSQL 8.3.3 and I'm having trouble with triggers not always
working. I have the following tables and functions as documented below. My
problem is that if I perform an update on the Entity table and modify the
Code field, why doesn't the trigger for the Entity table execut
On Wed, Mar 01, 2006 at 02:22:15PM +0100, [EMAIL PROTECTED] wrote:
> I want to setup a trigger capable to return more than one record.
Your example doesn't show anything related to triggers so I think
you mean "function" instead of "trigger." If the function can
return more than one row then it's
Hi,
I have a question about how much of a trigger is in a transaction.
I've read the docs and googled around but can't seem to find a
concrete answer.
I have two triggers that are designed to work together, one is a
before trigger and one is an after. If the before trigger succeeds
then it will
Hi,Was wondering if one can write triggers with SQL statements as we have in other RDBMS like SQL Server and oracle. Can these be written in procedural languages only?Please put some insight on what needs to be known before working with triggers in postgres.
I've already read the postgres manual in
OK, I'm hitting a wall here. I've written this trigger for partitioning:
create or replace function page_access_insert_trigger ()
returns trigger as $$
DECLARE
part text;
q text;
BEGIN
part = to_char(new."timestamp",'MMDD');
q = 'insert into page_access_'||part
How I cant optain de SQL (if is posible) of any STATEMENT in an AFTER Trigger
Function in C?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Dear all,
I have a single "source" table that is referenced by six
specialization tables, which include:
"journal_article"
"report"
4 more
There is a "citation" column in the source, which is what will be
displayed to users. This is generated by a trigger function on each
specialization table
Sarah Officer wrote:
> Can anyone set me straight here? An example of a trigger which
> calls a sql procedure would be much appreciated! I'd like the
> function to be able to access the rows which are being removed.
How about examples of a trigger that calls a *PL/pgSQL* procedure that
has acc
Oh, and one other thing...
The example has a typo. In the function, 'temp' and 'cust' should be the
same variable (doesn't matter what it's called).
Cheers,
Ed Loehr
Ed Loehr wrote:
> Sarah Officer wrote:
>
> > Can anyone set me straight here? An example of a trigger which
> > calls a sql pr
I want to write a simple trigger in SQL (i.e. use the trigger to execute
a simple function written in SQL). I'm having difficulty - CREATE TRIGGER
complains if the return type of the procedure is not 'OPAQUE', but CREATE
FUNCTION won't allow me to create SQL functions with a return type of
OPAQUE.
Hi,
I have a problem with triggers in postgresql 7.3.4 and PHP... I have a lot
of insert to do from a table x to table y ( average of 1 rows each
time). I use a trigger AFTER INSERT but it seems that PHP wait for the
result of the trigger to ending the script... Is it possible to avoid
waiting
hi,
i'm getting strange results when executing the code below. i would expect
that li_count in function foo and the select after calling this function
should return same values. can anyone explain me why i'm getting these
results, please?
thanks
kuba
example (using 7.1.2):
CREATE TABLE TC01 (
T
A table has TRIGGER BEFORE UPDATE, TRIGGER AFTER UPDATE and RULE ON UPDATE.
1. What is the order these three are executed?
2. Are the actions of one of them visible to the following ones, or they all
refer strictly to the record before update? E.g.: If the TRIGGER BEFORE
UPDATE changes a value in
On Sunday 21 January 2007 15:56, gustavo halperin
<[EMAIL PROTECTED]> wrote:
> First, thank you for your answers about my problem with the function
> 'CREATE TRIGGER',
> I have another question about triggers, how can I pass arguments ?? I
> read about some struct TriggerData *CurrentTriggerData,
On Sun, Jan 21, 2007 at 09:05:30PM -0800, Alan Hodgson wrote:
> On Sunday 21 January 2007 15:56, gustavo halperin <[EMAIL PROTECTED]> wrote:
> > I have another question about triggers, how can I pass arguments ?? I
> > read about some struct TriggerData *CurrentTriggerData, but I didn't
> > found a
On Monday 22 January 2007 07:04, Michael Fuhr <[EMAIL PROTECTED]> wrote:
> You can pass literal string arguments to a trigger function. See
> the CREATE TRIGGER documentation and, for PL/pgSQL, TG_ARGV and
> TG_NARGS. For C see "Writing Trigger Functions in C"; search for
> tgnargs and tgargs.
>
Hello I have a design question:
I have a table representing Families, and a table representing Persons.
The table Family have a row family_id as primary key.
The table Person have a row person_id as primary key and contain also a
row family_id.
As you can understand, the row family_id in a tabl
Hi list,
I am currently trying to give normal users some read access to some
tables in the database. I also need to give update access to one
column of one table.
I have the table contact, the user should not be able to read or
update anything in it, except for his own record. So I created the
vi
Hi all. I'm new with PostgreSQL and this is my
first post, so easy on me... :)
I'm thinking of using the native procedural
language and triggers to keep an audit trail. For editing changes, we only
keep a log of the modified fields and we create a record for each modified
value. The audit
Sergey Karin schrieb:
Hi, List!
Are there any plans to realize triggers on SELECT in new versions of PG?
What should they do?
You can always use a rule for this...
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
We are migrating from Informix to Postgres 7.4.7 and are having a
difficult time finding if postgres can insert/update tables across
different databases. Namely using functions/triggers when an
update/insert is performed on a table it updates/inserts in a table on a
different database. Informix
Dear All,
Is there a way to use locks within a trigger? My example below gives the
error:
ERROR: unexpected error -8 in EXECUTE of query "BEGIN"
CONTEXT: PL/pgSQL function "insert_into_t1" line 6 at execute statement
Thanks
Colin
CREATE FUNCTION insert_into_t1() RETURNS trigger AS'
DECLA
Bonjour,
J'ai un trigger (AFTER FOR EACH ROW) sur une table qui à chaque fois
qu'il y a un enregistrement sur cette même table, exécute une fonction
pgplsql qui éxécute elle-même une fonction PL/sh qui exécute un script
PHP.
Dans ce script PHP, je créer 10 enregistrements dans une autre tables où
"Dale Harris" <[EMAIL PROTECTED]> writes:
> I'm running PostgreSQL 8.3.3 and I'm having trouble with triggers not always
> working. I have the following tables and functions as documented below. My
> problem is that if I perform an update on the Entity table and modify the
> Code field, why doesn
t: Re: [GENERAL] Triggers not working
"Dale Harris" <[EMAIL PROTECTED]> writes:
> I'm running PostgreSQL 8.3.3 and I'm having trouble with triggers not
always
> working. I have the following tables and functions as documented below.
My
> problem is that if I p
"Dale Harris" <[EMAIL PROTECTED]> writes:
> The trigger trAccountUpdate got called, but why didn't the trigger
> trEntityUpdate get called?
Triggers only apply to the exact table they're declared on, not
to child tables.
It does seem like there might be some use-case for applying a trigger to
chi
:[EMAIL PROTECTED]
Sent: Tuesday, 23 September 2008 13:43
To: Dale Harris
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Triggers not working
"Dale Harris" <[EMAIL PROTECTED]> writes:
> The trigger trAccountUpdate got called, but why didn't the trigger
>
I want to use a function in to a trigger
This is my
CREATE FUNCTION "subradio"(integer) RETURNS integer AS 'select cast(count
(claveubica) as integer ) from asradios where ubicacion =0;' LANGUAGE 'sql';
And my ttrigger is
CREATE TRIGGER validaradios AFTER DELETE ON subestacion FOR EACH
Hi,
We run with multiple identical schemas in our db.
Each schema actually represents a clients db. What we’d like to do is
have a common schema where trigger functions and the like are held whilst each
trigger defined against the tables is in there own particular schema. This would
mean
On Thursday 20 April 2006 12:25 pm, "Chris Coleman" <[EMAIL PROTECTED]> thus
communicated:
--> Hi,
-->
--> I have a question about how much of a trigger is in a transaction.
--> I've read the docs and googled around but can't seem to find a
--> concrete answer.
-->
--> I have two triggers that are
Jasbinder Bali wrote:
> Hi,
> Was wondering if one can write triggers with SQL statements as we have
> in other RDBMS like SQL Server and oracle.
What would such a trigger "in SQL statements" look like?
SQL Server has Triggers in Transact-SQL, which is just something
like a pl/language.
> Can the
Actually Postgres manual of triggers says that in postgres, you can't write a trigger in conventional sql. You have to write it in a procedural language like C. So wanted some more insight on it.
~Jas
On 7/31/06, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
Jasbinder Bali wrote:> Hi,> Was wondering
Jasbinder Bali wrote:
Actually Postgres manual of triggers says that in postgres, you can't
write a trigger in conventional sql. You have to write it in a
procedural language like C. So wanted some more insight on it.
See chapters 35 - 39 of the manual for details. In particular a
discussion
# [EMAIL PROTECTED] / 2006-07-31 11:58:49 -0400:
> Actually Postgres manual of triggers says that in postgres, you can't write
> a trigger in conventional sql. You have to write it in a procedural language
> like C. So wanted some more insight on it.
> ~Jas
Where does it say so? Do you have a
http://www.postgresql.org/docs/8.1/interactive/triggers.html
it says something like this:
" It is not currently possible to write a trigger function in the plain SQL function language. "
though lately I saw triggers written in pure sql in postgres
~jas
On 8/1/06, Roman Neuhauser <[EMAIL PR
# [EMAIL PROTECTED] / 2006-08-01 02:35:48 -0400:
> On 8/1/06, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
> >
> ># [EMAIL PROTECTED] / 2006-07-31 11:58:49 -0400:
> >> Actually Postgres manual of triggers says that in postgres, you can't
> >write
> >> a trigger in conventional sql. You have to write
> http://www.postgresql.org/docs/8.1/interactive/triggers.html
>
> it says something like this:
>
> " It is not currently possible to write a trigger function in the
> plain SQL function language. "
The whole paragraph says.
"It is also possible to write a trigger function in C, although mos
Chris Mair <[EMAIL PROTECTED]> writes:
>> http://www.postgresql.org/docs/8.1/interactive/triggers.html
>> " It is not currently possible to write a trigger function in the
>> plain SQL function language. "
> The whole paragraph says.
> "It is also possible to write a trigger function in C, althou
Considering the following example.
Tables A and B.
Table A contains some data.
Table B reefers to table A using FK with 'on delete cascade'. Table B
has a trigger on it, after delete per row
Now, is there any way I can tell in the trigger on table B that it has
been called from a direct delete on
On Mon, Apr 27, 2009 at 2:32 PM, Scott Marlowe wrote:
> OK, I'm hitting a wall here. I've written this trigger for partitioning:
>
> create or replace function page_access_insert_trigger ()
> returns trigger as $$
> DECLARE
> part text;
> q text;
> BEGIN
> part = to_char(new.
On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe wrote:
> OK, I'm hitting a wall here. I've written this trigger for partitioning:
>
> create or replace function page_access_insert_trigger ()
> returns trigger as $$
> DECLARE
> part text;
> q text;
> BEGIN
> part = to_char(new.
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
wrote:
> On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe
> wrote:
>> OK, I'm hitting a wall here. I've written this trigger for partitioning:
>>
>> create or replace function page_access_insert_trigger ()
>> returns trigger as $$
>> DECLARE
>>
On Mon, Apr 27, 2009 at 03:37:22PM -0600, Scott Marlowe wrote:
> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote:
> > At this point I don't think that there is a way for this function to
> > know the correct table type of new.* since page_access_... is still
> > only a concatenated string.
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
wrote:
> On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe
> wrote:
>> OK, I'm hitting a wall here. I've written this trigger for partitioning:
>>
>> create or replace function page_access_insert_trigger ()
>> returns trigger as $$
>> DECLARE
>>
On 2009-04-29, Scott Marlowe wrote:
> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
> wrote:
>> On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe
>> wrote:
>>> OK, I'm hitting a wall here. I've written this trigger for partitioning:
>>>
>>> create or replace function page_access_insert_trigger
On Apr 29, 2009, at 4:14 AM, Jasen Betts wrote:
On 2009-04-29, Scott Marlowe wrote:
On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
wrote:
On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > wrote:
OK, I'm hitting a wall here. I've written this trigger for
partitioning:
create or replace
On Monday 27 April 2009 22:32:22 Scott Marlowe wrote:
> OK, I'm hitting a wall here. I've written this trigger for partitioning:
>
> create or replace function page_access_insert_trigger ()
> returns trigger as $$
> DECLARE
> part text;
> q text;
> BEGIN
> part = to_char(new."tim
On Tue, Apr 28, 2009 at 11:24 PM, Scott Marlowe wrote:
> On Tue, Apr 28, 2009 at 10:46 PM, David Fetter wrote:
>> On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote:
>>> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
>>> wrote:
>>> > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe
On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote:
> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
> wrote:
> > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe
> > wrote:
> >> OK, I'm hitting a wall here. I've written this trigger for partitioning:
> >>
> >> create or replace fun
Scott Marlowe escribió:
> Oh man, it just gets worse. I really need a simple elegant solution
> here, because if I try to build the query by hand null inputs make
> life a nightmare. I had built something like this:
>
> q = 'insert into '||schem||'.page_access_'||part||' values (
>
On Wed, Apr 29, 2009 at 4:23 AM, Alban Hertroys
wrote:
> On Apr 29, 2009, at 4:20 AM, Scott Marlowe wrote:
>
>> Oh man, it just gets worse. I really need a simple elegant solution
>> here, because if I try to build the query by hand null inputs make
>> life a nightmare. I had built something lik
I wonder if it would be easier to perodically replace the entire
trigger function with one that inserts to the correct table using
CRON+SED rather than dynamically building SQL. This might be a bad
idea however. I'm just thinking outside the box.
--
Regards,
Richard Broersma Jr.
Visit the Los
On Tue, Apr 28, 2009 at 10:46 PM, David Fetter wrote:
> On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote:
>> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma
>> wrote:
>> > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe
>> > wrote:
>> >> OK, I'm hitting a wall here. I've written
On Apr 29, 2009, at 4:20 AM, Scott Marlowe wrote:
Oh man, it just gets worse. I really need a simple elegant solution
here, because if I try to build the query by hand null inputs make
life a nightmare. I had built something like this:
q = 'insert into '||schem||'.page_access_'||part||' value
Hi, it seems it didn't make it the first time.
Début du message réexpédié :
De : Dimitri Fontaine
Date : 30 avril 2009 12:03:10 HAEC
À : pgsql-general@postgresql.org
Objet : Rép : [GENERAL] triggers and execute...
On Monday 27 April 2009 22:32:22 Scott Marlowe wrote:
OK, I'm hitt
On 21 Sep 2010, at 16:13, William Temperley wrote:
> Dear all,
>
> I have a single "source" table that is referenced by six
> specialization tables, which include:
> "journal_article"
> "report"
> 4 more
>
> e.g.:
> """
> update source set citation = get_report_citation(
>(select source
On 21 September 2010 18:39, Alban Hertroys
wrote:
> On 21 Sep 2010, at 16:13, William Temperley wrote:
>
>> Dear all,
>>
>> I have a single "source" table that is referenced by six
>> specialization tables, which include:
>> "journal_article"
>> "report"
>> 4 more
>>
>> e.g.:
>> """
>> update
If I understand correctly, you have something like this:
CREATE TABLE rec_* (
num integer primary key;
other ...
);
CREATE TABLE notes (
name CHAR(20),
numINTEGER,
note VARCHAR(200),
PRIMARY KEY(name, num)
);
So, you have many different tables like rec_*
What I'm after are triggers on delete fro several tables calling the same
procedure. I am not at liberty to change the schema of the database as I need
to accomodate what is actually an ancient system - that goes back before the
days of blobs and large text fields. In my example, deleting a r
Scott Holmes <[EMAIL PROTECTED]> writes:
> CREATE FUNCTION del_stxnoted () RETURNS opaque AS '
> DECLARE
> fname alias for $1;
> rkey alias for $2;
> BEGIN
> delete from stxnoted where filename = fname
>and record_key = rkey;
> END;'
> LANGUAGE 'plpgsql';
> create trigg
On Wed, 12 Jul 2000, Scott Holmes wrote:
> I'm afraid I just don't see how this is done without being able to pass
> arguments to the procedure or actually running an additional SQL statement
> within the trigger:
>
> I have a "notes" table that is potentially linked to records in many othe
On Sun, Sep 10, 2000 at 02:36:39PM -0400, Neil Conway wrote:
> I want to write a simple trigger in SQL (i.e. use the trigger to execute
> a simple function written in SQL). I'm having difficulty - CREATE TRIGGER
> complains if the return type of the procedure is not 'OPAQUE', but CREATE
> FUNCTION
Stephane Tessier wrote:
Hi,
I have a problem with triggers in postgresql 7.3.4 and PHP... I have a lot
of insert to do from a table x to table y ( average of 1 rows each
time). I use a trigger AFTER INSERT but it seems that PHP wait for the
result of the trigger to ending the script... Is it p
I believe you should design it in a slightly different way:
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of
>gustavo halperin
>Sent: donderdag 25 januari 2007 21:34
>To: pgsql-general@postgresql.org
>Subject: [GENERAL] triggers
> Hello I have a design question:
>
> I have a table representing Families, and a table representing Persons.
> The table Family have a row family_id as primary key.
> The table Person have a row person_id as primary key and contain also a
> row family_id.
> As you can understand, the row family_
Wijnand Wiersma wrote:
I have the table contact, the user should not be able to read or
update anything in it, except for his own record. So I created the
view v_my_account. When the user selects * from it he only sees his
own record. That works great. I also made a rule:
CREATE RULE update_v_my_
1 - 100 of 191 matches
Mail list logo