Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJIJH-0005r9-Fr for pgsql-odbc@arkaria.postgresql.org; Sat, 02 Jul 2016 10:38:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bJIJG-00033L-RJ for pgsql-odbc@arkaria.postgresql.org; Sat, 02 Jul 2016 10:38:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bJIIu-0002ek-7R for pgsql-odbc@postgresql.org; Sat, 02 Jul 2016 10:37:40 +0000 Received: from mailuogwhop.emc.com ([168.159.213.141]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bJIIk-000624-Lv for pgsql-odbc@postgresql.org; Sat, 02 Jul 2016 10:37:38 +0000 Received: from maildlpprd01.lss.emc.com (maildlpprd01.lss.emc.com [10.253.24.33]) by mailuogwprd02.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id u62AbC2a021065 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 2 Jul 2016 06:37:13 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd02.lss.emc.com u62AbC2a021065 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=emc.com; s=jan2013; t=1467455833; bh=VqQjLkLAzHmKV/ejk0d7l3/BsnA=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=ECoUnPDWnsCl+gYuQ8sV2/i2mrwvx5xM2Jic1pnq9zU9I81SDNSuirw5eY+uDH6Y1 O17J7Jtsi7iY7Vx+lxqF8FXMLt7kOOBKrdrxcqqOCM5O4b3VmoLMpENitBQdjODm4L 8x+KGW2nKfoI4EwumzVDnspcIXq1HsUr02sMZCOM= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd02.lss.emc.com u62AbC2a021065 Received: from mailusrhubprd53.lss.emc.com (mailusrhubprd53.lss.emc.com [10.106.48.18]) by maildlpprd01.lss.emc.com (RSA Interceptor); Sat, 2 Jul 2016 06:36:32 -0400 Received: from MXHUB104.corp.emc.com (MXHUB104.corp.emc.com [10.253.58.16]) by mailusrhubprd53.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id u62AaqlG015708 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sat, 2 Jul 2016 06:36:53 -0400 Received: from MX205CL01.corp.emc.com ([fe80::cc4c:9d93:e0ea:e9ce]) by MXHUB104.corp.emc.com ([::1]) with mapi id 14.03.0266.001; Sat, 2 Jul 2016 06:36:52 -0400 From: "Venkatesan, Sekhar" To: "Inoue, Hiroshi" CC: "Tsunakawa, Takayuki" , Adrian Klaver , "Joshua D. Drake" , "pgsql-odbc@postgresql.org" Subject: Re: Updateable cursors ODBC configuration Partition Issue Thread-Topic: [ODBC] Updateable cursors ODBC configuration Partition Issue Thread-Index: AdHTd3bL5iuX17ChRrKGiF41ybVqwgAmnN0AAA6QE8A= Date: Sat, 2 Jul 2016 10:36:51 +0000 Message-ID: References: <5776FCCE.7080809@dream.email.ne.jp> In-Reply-To: <5776FCCE.7080809@dream.email.ne.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.42.45.19] Content-Type: multipart/alternative; boundary="_000_F84DE43FDACD4C45AA84E2DA016FAE2F1D104DF4MX205CL01corpem_" MIME-Version: 1.0 X-Sentrion-Hostname: mailusrhubprd53.lss.emc.com X-RSA-Classifications: public X-Pg-Spam-Score: -5.6 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org --_000_F84DE43FDACD4C45AA84E2DA016FAE2F1D104DF4MX205CL01corpem_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Though table alias is not required in this case :), if I have table alias i= t should be included in the resultant SQL which is getting missed when "upd= ateable cursors" is enabled. I am not seeing this issue with linux. Looks to be specific to windows driv= er. From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp] Sent: Saturday, July 02, 2016 4:59 AM To: Venkatesan, Sekhar Cc: Tsunakawa, Takayuki; Adrian Klaver; Joshua D. Drake; pgsql-odbc@postgre= sql.org Subject: Re: [ODBC] Updateable cursors ODBC configuration Partition Issue On 2016/07/01 18:07, Venkatesan, Sekhar wrote: Hi Guys, I see yet another issue when data partition is enabled and "updateable curs= ors" option is enabled in odbc DSN. Updateable cursors performs "select for update" cursor and when the Postgre= SQL cursor is created for a select query, the resultant statement is as bel= ow: The original SQL fired from our application is: "SELECT AFD_.r_object_id,AFD_.name,AFD_.stamp,AFD_.sent_by,AFD_.date_sent,A= FD_.due_date,AFD_.event,AFD_.item_name,AFD_.item_id,AFD_.item_type,AFD_.con= tent_type,AFD_.message,AFD_.router_id,AFD_.supervisor_name,AFD_.task_number= ,AFD_.task_name,AFD_.task_type,AFD_.task_state,AFD_.dependency_type,AFD_.ne= xt_tasks_type,AFD_.instruction_page,AFD_.plan_start_date,AFD_.actual_start_= date,AFD_.read_flag,AFD_.delete_flag,AFD_.priority,AFD_.position,AFD_.deque= ued_by,AFD_.dequeued_date,AFD_.sign_off_required,AFD_.sign_off_user,AFD_.si= gn_off_date,AFD_.a_content_type,AFD_.a_operations,AFD_.source_docbase,AFD_.= target_docbase,AFD_.remote_pending,AFD_.source_event,AFD_.source_stamp,AFD_= .task_subject,AFD_.i_event_flags,AFD_.event_detail,AFD_.i_partition,AFD_.i_= is_replica,AFD_.i_vstamp FROM dmi_queue_item_s AFD_ WHERE ((AFD_.name=3DN'A= dministrator' AND AFD_.read_flag=3D0) AND AFD_.delete_flag=3D0)" Hmm, table alias AFD_. is necessary for the above statement? regards, Hiroshi Inoue whereas this is converted to: "SELECT AFD_.r_object_id,AFD_.name,AFD_.stamp,AFD_.sent_by,AFD_.date_sent,AFD_.due_= date,AFD_.event,AFD_.item_name,AFD_.item_id,AFD_.item_type,AFD_.content_typ= e,AFD_.message,AFD_.router_id,AFD_.supervisor_name,AFD_.task_number,AFD_.ta= sk_name,AFD_.task_type,AFD_.task_state,AFD_.dependency_type,AFD_.next_tasks= _type,AFD_.instruction_page,AFD_.plan_start_date,AFD_.actual_start_date,AFD= _.read_flag,AFD_.delete_flag,AFD_.priority,AFD_.position,AFD_.dequeued_by,A= FD_.dequeued_date,AFD_.sign_off_required,AFD_.sign_off_user,AFD_.sign_off_d= ate,AFD_.a_content_type,AFD_.a_operations,AFD_.source_docbase,AFD_.target_d= ocbase,AFD_.remote_pending,AFD_.source_event,AFD_.source_stamp,AFD_.task_su= bject,AFD_.i_event_flags,AFD_.event_detail,AFD_.i_partition,AFD_.i_is_repli= ca,AFD_.i_vstamp , "ctid", "tableoid" from "repo50"."p1_dmi_queue_item_s" w= here ctid =3D currtid2('"repo50"."p1_dmi_queue_item_s"', '(13, 28)')" Notice that "p1_dmi_queue_item_s" is a partitioned table. Here the highligh= ted color is generated by postgresql for faster execution. But the table al= ias is not added to the partitioned table (AFD_ is not added to p1_dmi_queu= e_item_s) due to which the SQL fails to execute with the below error: ERROR: missing FROM-clause entry for table "afd_" at character 8 Is this a known issue? Is there any fix? If so, is it in psqlODBC or in the= server itself? Thanks, Sekhar --_000_F84DE43FDACD4C45AA84E2DA016FAE2F1D104DF4MX205CL01corpem_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Though table alias is = not required in this case J, if I have table alias it should be included in the = resultant SQL which is getting missed when “updateable cursors”= is enabled.

I am not seeing this i= ssue with linux. Looks to be specific to windows driver.<= /p>

 

From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: Saturday, July 02, 2016 4:59 AM
To: Venkatesan, Sekhar
Cc: Tsunakawa, Takayuki; Adrian Klaver; Joshua D. Drake; pgsql-odbc@= postgresql.org
Subject: Re: [ODBC] Updateable cursors ODBC configuration Partition = Issue

 

 

On 2016/07/01 18:07, Venkatesan, Sekhar wrote:<= /o:p>

Hi Guys,

 

I see yet another issue when data partition is enabl= ed and “updateable cursors” option is enabled in odbc DSN.=

Updateable cursors performs “select for update= ” cursor and when the PostgreSQL cursor is created for a select query= , the resultant statement is as below:

The original SQL fired from our application is:=

“SELECT AFD_.r_object_id,AFD_.name,AFD_.stamp,= AFD_.sent_by,AFD_.date_sent,AFD_.due_date,AFD_.event,AFD_.item_name,AFD_.it= em_id,AFD_.item_type,AFD_.content_type,AFD_.message,AFD_.router_id,AFD_.sup= ervisor_name,AFD_.task_number,AFD_.task_name,AFD_.task_type,AFD_.task_state= ,AFD_.dependency_type,AFD_.next_tasks_type,AFD_.instruction_page,AFD_.plan_= start_date,AFD_.actual_start_date,AFD_.read_flag,AFD_.delete_flag,AFD_.prio= rity,AFD_.position,AFD_.dequeued_by,AFD_.dequeued_date,AFD_.sign_off_requir= ed,AFD_.sign_off_user,AFD_.sign_off_date,AFD_.a_content_type,AFD_.a_operati= ons,AFD_.source_docbase,AFD_.target_docbase,AFD_.remote_pending,AFD_.source= _event,AFD_.source_stamp,AFD_.task_subject,AFD_.i_event_flags,AFD_.event_de= tail,AFD_.i_partition,AFD_.i_is_replica,AFD_.i_vstamp FROM dmi_queue_item_s AFD_ WHERE ((AFD_.name=3DN'Administrator' AND AFD_.r= ead_flag=3D0) AND AFD_.delete_flag=3D0)”


Hmm,  table alias AFD_. is necessary for the above statement?

regards,
Hiroshi Inoue

 

whereas this is converted to:

 

“SELECT

AFD_.r_object_id,AFD_.name,AFD_.stamp,AFD_.se= nt_by,AFD_.date_sent,AFD_.due_date,AFD_.event,AFD_.item_name,AFD_.item_id,A= FD_.item_type,AFD_.content_type,AFD_.message,AFD_.router_id,AFD_.supervisor= _name,AFD_.task_number,AFD_.task_name,AFD_.task_type,AFD_.task_state,AFD_.d= ependency_type,AFD_.next_tasks_type,AFD_.instruction_page,AFD_.plan_start_d= ate,AFD_.actual_start_date,AFD_.read_flag,AFD_.delete_flag,AFD_.priority,AF= D_.position,AFD_.dequeued_by,AFD_.dequeued_date,AFD_.sign_off_required,AFD_= .sign_off_user,AFD_.sign_off_date,AFD_.a_content_type,AFD_.a_operations,AFD= _.source_docbase,AFD_.target_docbase,AFD_.remote_pending,AFD_.source_event,= AFD_.source_stamp,AFD_.task_subject,AFD_.i_event_flags,AFD_.event_detail,AF= D_.i_partition,AFD_.i_is_replica,AFD_.i_vstamp , "ctid", "tableoid" from "repo50"."= p1_dmi_queue_item_s" where ctid = =3D currtid2('"repo50"."p1_dmi_queue_item_s"', '(13, 28= )')”

 

Notice that "p1_dmi_queue_item_s" i= s a partitioned table. Here the highlighted color is generated by postgresql for faster execut= ion. But the table alias is not added to the partitioned table (AFD_ is not adde= d to p1_dmi_queue_item_s) due to which the SQL fails to execute with the be= low error:

ERROR:  missing FROM-clause entry for table = "afd_" at character 8

 

Is this a known issue? Is there any fix? If so, is i= t in psqlODBC or in the server itself?

 

Thanks,

Sekhar

--_000_F84DE43FDACD4C45AA84E2DA016FAE2F1D104DF4MX205CL01corpem_--