Perfect! Thenx!
-R
On Thu, 2007-01-11 at 12:26 -0800, Adrian Klaver wrote:
> On Thursday 11 January 2007 10:26 am, Rafal Pietrak wrote:
> > On Thu, 2007-01-11 at 15:10 +0100, Alban Hertroys wrote:
> > > Rafal Pietrak wrote:
> > > > Hi!
> > > >
> > > > I'm re-posting this message again in hope som
On Thursday 11 January 2007 10:26 am, Rafal Pietrak wrote:
> On Thu, 2007-01-11 at 15:10 +0100, Alban Hertroys wrote:
> > Rafal Pietrak wrote:
> > > Hi!
> > >
> > > I'm re-posting this message again in hope someone would have a look at
> > > the case again. .. it's pending.
> >
> > You were given
Martijn van Oosterhout writes:
> On Thu, Jan 11, 2007 at 07:26:32PM +0100, Rafal Pietrak wrote:
>> So may be "SET CONSTRAINTS DEFERRED " should be used somehow
>> differently? I've never had any use for that construct, may be I miss
>> something?
> Only at the beginning of a transaction and
On Thu, Jan 11, 2007 at 07:26:32PM +0100, Rafal Pietrak wrote:
> Well. I were, but probably I'm doing something wrong with 'deferring the
> trigger'. When I put:
>
> "SET CONSTRAINTS ALL DEFERRED ; "
>
> *before* the UPDATE statement *within* the trigger function (just after
> BEGIN statement t
On Thu, 2007-01-11 at 15:10 +0100, Alban Hertroys wrote:
> Rafal Pietrak wrote:
> > Hi!
> >
> > I'm re-posting this message again in hope someone would have a look at
> > the case again. .. it's pending.
>
> You were given a solution; defer the foreign key constraint.
Well. I were, but probab
Rafal Pietrak wrote:
> Hi!
>
> I'm re-posting this message again in hope someone would have a look at
> the case again. .. it's pending.
You were given a solution; defer the foreign key constraint.
Alternatively, you may want to re-think your trigger function so that it
does things in the rig
On Thu, Jan 11, 2007 at 01:01:24PM +0100, Rafal Pietrak wrote:
> Hi!
>
> I'm re-posting this message again in hope someone would have a look at
> the case again. .. it's pending.
Well, I can't help with the details because I can't see what you're
trying to do, but I'm fairly sure you can't cha
Hi!
I'm re-posting this message again in hope someone would have a look at
the case again. .. it's pending.
In postgres v7.2 I had a trigger function launched BEFORE INSERT, which
did everything I needed (like an UPDATE of other table inside of that
trigger function, and adjustment of the INSE
On Tue, 2007-01-09 at 10:44 -0500, Tom Lane wrote:
> Rafal Pietrak <[EMAIL PROTECTED]> writes:
> > 1. either the new value of "test_days.dnia" as already present in the
> > NEW row, is not visible to "UPDATE test_utarg" sub-statement of the same
> > transaction. But earlier versions of Postgres did
Rafal Pietrak <[EMAIL PROTECTED]> writes:
> 1. either the new value of "test_days.dnia" as already present in the
> NEW row, is not visible to "UPDATE test_utarg" sub-statement of the same
> transaction. But earlier versions of Postgres did allow for that
> visibility.
> 2. or the constrainets in e
Uuups... That's what I feared of. I was a bit hasty and nervous after
I've discovered, that the old schema doesn't work. Sory for that.
An yet, the original question remain. After I've change the TRIGGER to
"FOR EACH ROW", I get:
---
database=# C
Rafal Pietrak <[EMAIL PROTECTED]> writes:
> Hi All!
>
> I have some old piece of code, that worked two years ago (Postgres
> version 7.2, I think), but doesn't work within Postgres 8.1.4 now.
>
> The story is, that I have a trigger on a table (business day
> statistics), that is fired before ins
Hi All!
I have some old piece of code, that worked two years ago (Postgres
version 7.2, I think), but doesn't work within Postgres 8.1.4 now.
The story is, that I have a trigger on a table (business day
statistics), that is fired before insert; it updates another table
(detailed transaction log),
Hi!
>> How could i stop Inserting record into table by some condition?
RH> RETURN null when using a before trigger. Or raise an exception to abort
RH> the whole transaction.
Thanx ;)
RETURN NULL works so as i need
---(end of broadcast)---
TIP 5:
ON.KG wrote:
How could i stop Inserting record into table by some condition?
RETURN null when using a before trigger. Or raise an exception to abort
the whole transaction.
--
Richard Huxton
Archonet Ltd
---(end of broadcast)---
TIP 1: subscribe
Hi all,
===
CREATE FUNCTION trigger_test_func()
RETURNS trigger
AS '
DECLARE
cnt int4;
BEGIN
SELECT INTO cnt COUNT(*)
FROM table_test
WHERE ip = new.ip;
IF cnt > 50 THEN
-- THERE THE "INSERT" HAS TO BE STOPED
END IF;
RETURN new;
END;'
16 matches
Mail list logo