On Wed, Nov 2, 2016 at 4:06 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:On Wed, Nov 2, 2016 at 3:55 PM, Michael Moore <michaeljmoore@gmail.com> wrote:David, I think that: ...Method 1create temporary table if not exists temp_rslt of ypxportal2__fgetquestions on commit drop;is not functionally equivalent to Method 2drop table if exists temp_rslt;create temporary table temp_rslt of ypxportal2__fgetquestions on commit drop;For example:step 1. A calls Bstep 2. B creates temp_rslt table (substitute Method 1 or Method 2 at this step) step 3. B inserts one record into temp_rsltstep 4. B returns, without error, to A -- note, no commit is donestep 5. repeat #1If, at step 2, we use Method 1, then count(*) temp_rslt will never be more than 1.If, at step 2, we use Method 2, then count(*) temp_rslt will increment with each iteration of steps 1 thru 5.Make sense?You missed the part where you immediately TRUNCATE the table after conditionally creating it...And no, Method 2 will reset since you are continually dropping it.Method 1, without Truncate, will do the incrementing while Method 2 will not.David J.
On Wed, Nov 2, 2016 at 3:55 PM, Michael Moore <michaeljmoore@gmail.com> wrote:David, I think that: ...Method 1create temporary table if not exists temp_rslt of ypxportal2__fgetquestions on commit drop;is not functionally equivalent to Method 2drop table if exists temp_rslt;create temporary table temp_rslt of ypxportal2__fgetquestions on commit drop;For example:step 1. A calls Bstep 2. B creates temp_rslt table (substitute Method 1 or Method 2 at this step) step 3. B inserts one record into temp_rsltstep 4. B returns, without error, to A -- note, no commit is donestep 5. repeat #1If, at step 2, we use Method 1, then count(*) temp_rslt will never be more than 1.If, at step 2, we use Method 2, then count(*) temp_rslt will increment with each iteration of steps 1 thru 5.Make sense?You missed the part where you immediately TRUNCATE the table after conditionally creating it...
David, I think that: ...Method 1create temporary table if not exists temp_rslt of ypxportal2__fgetquestions on commit drop;is not functionally equivalent to Method 2drop table if exists temp_rslt;create temporary table temp_rslt of ypxportal2__fgetquestions on commit drop;For example:step 1. A calls Bstep 2. B creates temp_rslt table (substitute Method 1 or Method 2 at this step) step 3. B inserts one record into temp_rsltstep 4. B returns, without error, to A -- note, no commit is donestep 5. repeat #1If, at step 2, we use Method 1, then count(*) temp_rslt will never be more than 1.If, at step 2, we use Method 2, then count(*) temp_rslt will increment with each iteration of steps 1 thru 5.Make sense?
pgsql-sql by date:
Соглашаюсь с условиями обработки персональных данных