Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id CD4D0A9C686 for ; Thu, 14 Jun 2012 23:19:02 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SfM7n-0001rc-ME for pgsql-sql@postgresql.org; Fri, 15 Jun 2012 02:19:01 +0000 Received: by dady13 with SMTP id y13so3367470dad.19 for ; Thu, 14 Jun 2012 19:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=HdtXhLRNfT5Ib0O8/7cyxoDnF/Rqy8IubUkN0/+Or74=; b=kfMHwhAw9r0cQ4pgiGDLnS6EBl6YxphUYveFrhaVDbBaHL0lEhVQcu8kNIRcgjc/SA wv7Qkt4u0QdrS4FeEuYu8t5J2bK0fFa8yCLrGQ2s/fcSBikqtlfyJOCPHR9uvUXXRX7N r9K5f8E7zPjWHm/501VcIz0wHeusDaUVgwE7BFE3PYs/j0PAJEbBKZ2b8VE6lGnfkYf9 hEOTmKcA+/9PPjiVchqC+YAoz5ukt7mjT9LXlEHch7w+8A4VFImhsDZQ5doYoP9HNZTF uCEkrOzPl7gIin4BtUXc4CPmuhZ87INoVEb1Kc5tXAoc5MMUpo9VyxGkzfYJST1aJMA+ QHvA== Received: by 10.68.204.129 with SMTP id ky1mr15411787pbc.32.1339726724873; Thu, 14 Jun 2012 19:18:44 -0700 (PDT) Received: from [192.168.0.3] (c-24-17-164-54.hsd1.wa.comcast.net. [24.17.164.54]) by mx.google.com with ESMTPS id to1sm11495833pbc.27.2012.06.14.19.18.43 (version=SSLv3 cipher=OTHER); Thu, 14 Jun 2012 19:18:44 -0700 (PDT) Message-ID: <4FDA9B58.7040503@gmail.com> Date: Thu, 14 Jun 2012 19:18:00 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Achilleas Mantzios CC: pgsql-sql@postgresql.org Subject: Re: Insane behaviour in 8.3.3 References: <201206141139.35601.achill@matrix.gatewaynet.com> In-Reply-To: <201206141139.35601.achill@matrix.gatewaynet.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201206/35 X-Sequence-Number: 36689 On 06/14/2012 01:39 AM, Achilleas Mantzios wrote: > Hello,one remote user reported a problem and i was surprised to witness the following behaviour. > It is on postgresql 8.3.3 > > dynacom=# BEGIN; > BEGIN > dynacom=# > dynacom=# > dynacom=# insert into xadmin(appname,apptbl_tmp,gao,id,comment) > dynacom-# values('PMS','overhaul_report_tmp','INSERT',nextval('overhaul_report_tmp_pkid_seq'),' zzz '); > INSERT 0 1 > dynacom=# > dynacom=# insert into items_tmp(id,vslwhid,serialno,rh,lastinspdate,classused,classsurvey,classsurveydate,classduedate, > dynacom(# classpostponed,classcomment,defid,machtypecount,totalrh,comment,attachments,lastrepdate,pmsstate,xid,classaa) > dynacom-# select id,vslwhid,serialno,rh,lastinspdate,classused,classsurvey,classsurveydate,classduedate,classpostponed, > dynacom-# classcomment,defid,machtypecount,totalrh,comment,attachments,lastrepdate,pmsstate,currval('xadmin_xid_seq'), > dynacom-# classaa from items where id=1261319; > INSERT 0 1 > dynacom=# -- in the above 'xadmin_xid_seq' has taken a new value in the first insert > dynacom=# SELECT currval('xadmin_xid_seq'); > currval > --------- > 61972 > (1 row) > dynacom=# SELECT id from items_tmp WHERE id=1261319 AND xid=61972; > id > --------- > 1261319 > (1 row) > dynacom=# -- ok this is how it should be > dynacom=# SELECT id from items_tmp WHERE id=1261319 AND xid=currval('xadmin_xid_seq'); > id > ---- > (0 rows) > dynacom=# -- THIS IS INSANE > > This code has run fine (the last SELECT returns exactly one row) for 5,409,779 total transactions thus far, in 70 > different postgresql slave installations (mixture of 8.3.3 and 8.3.13) (we are a shipping company), > until i got this error report from a user yesterday. > > What could be causing this? How could i further investigate this? The only thing I could come up with is: SELECT id, currval('xadmin_xid_seq') from items_tmp WHERE id=1261319 ; Its grasping at straws, but I can not come up with a logical reason for the above. > Achilleas Mantzios > IT DEPT > -- Adrian Klaver adrian.klaver@gmail.com