Re: rules problem

From: Joshua Moore-Oliva <josh(at)chatgris(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: rules problem
Date: 2003-03-21 10:18:16
Message-ID: 200303210518.16577.josh@chatgris.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Usually it's a good idea to get rid of errors?

Hope you got the big foam HOS on :)

Josh.

On March 21, 2003 05:18 am, Georgi Chorbadzhiyski wrote:
> Hi, I have strange problem with rules. It looks like when multiple rows
> are affected, the rule is executed only for the first row.
> Is this expected behaviour? Please someone hit me with a cluebat :)
>
> Please try the attached two tests to see what I mean.
> The tests are for pgsql-7.2 if you want to try them on 7.3 after
> DROP TABLE xxx add CASCADE, and remove DROP RULE xxx lines.
>
> Here's what I see:
>
> *** First test ***
> DROP
> CREATE
> DROP
> CREATE
> ERROR: Rule or view "add_to_data" not found
> CREATE
> ERROR: Rule or view "del_from_data" not found
> CREATE
> INSERT 357883308 1
> INSERT 357883309 1
> INSERT 357883310 1
> INSERT 357883311 1
> INSERT 357883312 1
> id | data_counters | expected
> ----+---------------+------------------------------
> 1 | 4 | data_counters should be == 4
> (1 row)
>
> DELETE 4
> id | data_counters | expected
> ----+---------------+------------------------------------
> 1 | 3 | data_counters should be == 0 NOT 3
> (1 row)
>
>
> *** Second test ***
> DROP
> CREATE
> DROP
> CREATE
> ERROR: Rule or view "add_to_data" not found
> CREATE
> ERROR: Rule or view "del_from_data" not found
> CREATE
> INSERT 357886505 1
> INSERT 357886506 1
> INSERT 357886507 1
> INSERT 357886508 1
> INSERT 357886509 1
> id | data_counters | expected
> ----+---------------+------------------------------
> 1 | 4 | data_counters should be == 4
> (1 row)
>
> DELETE 1
> DELETE 1
> DELETE 1
> DELETE 1
> id | data_counters | expected
> ----+---------------+------------------------------
> 1 | 0 | data_counters should be == 0
> (1 row)

In response to

  • rules problem at 2003-03-21 10:18:01 from Georgi Chorbadzhiyski

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michal Adamczak 2003-03-21 11:28:24 constraint function, newbie
Previous Message Georgi Chorbadzhiyski 2003-03-21 10:18:01 rules problem