Re: Should we SetQuerySnapshot() between actions of a rule?

From: "Hiroshi Inoue" <inoue(at)tpf(dot)co(dot)jp>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Should we SetQuerySnapshot() between actions of a rule?
Date: 2003-05-03 14:17:18
Message-ID: 01b801c3117e$b5f10950$0e283ddb@PbgX
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Tom Lane
>
> I just noticed that there is an inconsistency between the way that
> PREPARE executes multiple queries (since PREPARE itself accepts
> only one SQL statement, any such multiple queries must have been
> generated by rule expansion) and the way that it is done in
> pg_exec_query_string(). The latter will do a SetQuerySnapshot()
> between actions of the rule, the former only does
> CommandCounterIncrement().
>
> If you're in a serializable transaction then there's no difference
> in behavior. But in READ COMMITTED mode this means that later actions
> in the rule may be able to see the effects of other transactions that
> committed while earlier actions were running.
>
> ISTM we had better make the behavior consistent between PREPARE and
> interactive execution. But which one do we want? I could see an
> argument that it'd be best for all the actions of a rule to see a
> consistent snapshot of the state of other transactions;

Is it appropriate to use the word *snapshot* for queries other than
read-only ones ?

regards,
Hiroshi Inoue

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2003-05-03 15:13:30 Re: [HACKERS] Join Stallman and Software SMEs to refuse sofware patents
Previous Message Bradley Baetz 2003-05-03 06:47:25 CVS psql segfault