Re: Transaction question

From: Jeff Ross <jross(at)wykids(dot)org>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Transaction question
Date: 2012-07-11 14:01:14
Message-ID: 4FFD872A.9060200@wykids.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/10/12 8:39 PM, Adrian Klaver wrote:
> On 07/10/2012 07:30 PM, Jeff Ross wrote:
>> On 7/10/12 6:21 PM, Adrian Klaver wrote:
>>> On 07/10/2012 01:06 PM, Jeff Ross wrote:
>>>> Hi all,
>>>>
>
>>>>
>>>> Thanks for any and all ideas!
>>>
>>> For your initial attempt everything was done in one session?
>>
>> All the inserts were done in one session, yes.
>>>
>>> I am also confused by this:
>>> 2012-06-19 15:37:36.258912500 <www%wykids> LOG: statement: commit
>>> 2012-06-19 15:29:11.573396500 <www%wykids> LOG: statement: update
>>> survey_response set srv_resp_submitted = now() where srv_resp_srv_id =
>>> 2 and srv_resp_pp_id = 25399
>>>
>>> Note the time stamps. Is this the actual log?
>>
>> Crap. I noticed that I'd somehow got another update statement when I
>> pasted into the e-mail so I altered the srv_resp_pp_id to match rather
>> than go get the real entry from the logs again. That is for sure my bad
>> and I apologize! The sequence of events are as I described, though. The
>> inserts happen inside a transaction, the update happens immediately
>> after the commit.
>
> So would it be possible to see the actual log sequence?
>
Absolutely.

2012-06-19 15:37:36.149840500 <www%wykids> LOG: statement: SET
DATESTYLE TO SQL, MDY
2012-06-19 15:37:36.150735500 <www%wykids> LOG: statement: create temp
table if not exists rank_test (value integer unique not null)
2012-06-19 15:37:36.201496500 <www%wykids> LOG: statement: truncate
rank_test
2012-06-19 15:37:36.218830500 <www%wykids> LOG: statement: insert into
rank_test values(5)
2012-06-19 15:37:36.220442500 <www%wykids> LOG: statement: insert into
rank_test values(4)
2012-06-19 15:37:36.221109500 <www%wykids> LOG: statement: insert into
rank_test values(3)
2012-06-19 15:37:36.221654500 <www%wykids> LOG: statement: insert into
rank_test values(2)
2012-06-19 15:37:36.222142500 <www%wykids> LOG: statement: insert into
rank_test values(1)
2012-06-19 15:37:36.222759500 <www%wykids> LOG: statement: begin
2012-06-19 15:37:36.223783500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','13',NULL,NULL,'5','1')
2012-06-19 15:37:36.232725500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','13',NULL,NULL,'4','2')
2012-06-19 15:37:36.234958500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','13',NULL,NULL,'3','3')
2012-06-19 15:37:36.237111500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','13',NULL,NULL,'2','4')
2012-06-19 15:37:36.239208500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','13',NULL,NULL,'1','5')
2012-06-19 15:37:36.241350500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','15','4',NULL,NULL,NULL)
2012-06-19 15:37:36.244361500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','16',NULL,'Difficult behaviors',NULL,'1')
2012-06-19 15:37:36.246509500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','16',NULL,'Collecting from parents',NULL,'2')
2012-06-19 15:37:36.248644500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','16',NULL,'How to still have a life outside child
care.',NULL,'3')
2012-06-19 15:37:36.250742500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','17','1',NULL,NULL,NULL)
2012-06-19 15:37:36.252916500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','18','1',NULL,NULL,NULL)
2012-06-19 15:37:36.255100500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','19','1',NULL,NULL,NULL)
2012-06-19 15:37:36.257256500 <www%wykids> LOG: statement: INSERT INTO
survey_answers
(srv_answers_srv_id,srv_answers_pp_id,srv_answers_question_id,srv_answers_answer,srv_answers_answer_text,srv_answers_rank,srv_answers_sub_question_id)
VALUES ('2','25399','20','1',NULL,NULL,NULL)
2012-06-19 15:37:36.258912500 <www%wykids> LOG: statement: commit
2012-06-19 15:37:36.283752500 <www%wykids> LOG: statement: update
survey_response set srv_resp_submitted = now() where srv_resp_srv_id = 2
and srv_resp_pp_id = 25399

Thanks!

>>>>
>>>> Jeff Ross
>>>> Wyoming Children's Action Alliance
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-07-11 14:07:15 Re: Bug? Prepared queries continue to use search_path from their preparation time
Previous Message Efraín Déctor 2012-07-11 13:32:40 Re: Error with plpython