Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. doc: Small example improvement

  1. Unexpected output of PgRules

    Manav Kumar <mkumar@yugabyte.com> — 2025-05-14T09:14:30Z

    Hi Team,
    I'm writing to clarify one of the expected output in rules.out file.
    
    Why does value at this line
    https://github.com/postgres/postgres/blob/913c60b067aa1a618420fd0372c4df3cf5501863/src/test/regress/expected/rules.out#L594
    for rtest_t6 is zeros. When we have defined the rule for rtest_t6 as:
    create rule rtest_t4_ins2 as on insert to rtest_t4
    where new.a >= 20 and new.a < 30 do
    insert into rtest_t6 values (new.a, new.b);
    
    Therefore:
    At
    https://github.com/postgres/postgres/blob/913c60b067aa1a618420fd0372c4df3cf5501863/src/test/regress/expected/rules.out#L576
    / insert into rtest_t4 select * from rtest_t9 where b ~ 'and t8';
    Shouldn't insert the rows with value as  26 and 28 as well. Isn't it ? as
    rules says to insert the rows in rtest_t6 tables if value is from
    20(inclusive) to 30 (exclusive).
    
    Please help me with the clarification.
    
    Thanks
    Manav
    
  2. Re: Unexpected output of PgRules

    Manav Kumar <mkumar@yugabyte.com> — 2025-05-14T10:40:14Z

    Please ignore the above email. I've understood the reason as below:
    Because of 2 rules:
    
    1. create rule rtest_t4_ins2 as on insert to rtest_t4
    
    where new.a >= 20 and new.a < 30 do
    
    insert into rtest_t6 values (new.a, new.b);
    
    
    
    2. create rule rtest_t6_ins as on insert to rtest_t6
    
    where new.a > 25 do instead
    
    insert into rtest_t8 values (new.a, new.b);
    
    
    The insertion doesn't happen in rtest_t6 rather is forwarded or been done
    into rtest_t8.
    Pardon me.
    Thanks
    
    On Wed, May 14, 2025 at 2:44 PM Manav Kumar <mkumar@yugabyte.com> wrote:
    
    > Hi Team,
    > I'm writing to clarify one of the expected output in rules.out file.
    >
    > Why does value at this line
    > https://github.com/postgres/postgres/blob/913c60b067aa1a618420fd0372c4df3cf5501863/src/test/regress/expected/rules.out#L594
    > for rtest_t6 is zeros. When we have defined the rule for rtest_t6 as:
    > create rule rtest_t4_ins2 as on insert to rtest_t4
    > where new.a >= 20 and new.a < 30 do
    > insert into rtest_t6 values (new.a, new.b);
    >
    > Therefore:
    > At
    > https://github.com/postgres/postgres/blob/913c60b067aa1a618420fd0372c4df3cf5501863/src/test/regress/expected/rules.out#L576
    > / insert into rtest_t4 select * from rtest_t9 where b ~ 'and t8';
    > Shouldn't insert the rows with value as  26 and 28 as well. Isn't it ? as
    > rules says to insert the rows in rtest_t6 tables if value is from
    > 20(inclusive) to 30 (exclusive).
    >
    > Please help me with the clarification.
    >
    > Thanks
    > Manav
    >
    >
    >