Thread: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrongcount in SQLRowCount
[ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrongcount in SQLRowCount
From
"Asif Shaikh"
Date:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
- SQLDriverConnect - to connect to driver
- SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
- SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
- SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
- SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0 - Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>. - After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
- Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift,is returning wrong count in SQLRowCount
From
"Inoue, Hiroshi"
Date:
Hi,
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
- SQLDriverConnect - to connect to driver
- SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
- SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
- SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
- SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0- Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.- After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
- Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, isreturning wrong count in SQLRowCount
From
"Asif Shaikh"
Date:
Hi Hiroshi Inoue,
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift,is returning wrong count in SQLRowCount
From
"Inoue, Hiroshi"
Date:
Hi,
Attached is a sample test program.
regards,
Hiroshi Inoue
Attached is a sample test program.
regards,
Hiroshi Inoue
On 2017/08/17 12:54, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh
Attachment
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, isreturning wrong count in SQLRowCount
From
"Asif Shaikh"
Date:
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 03:21 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
Attached is a sample test program.
regards,
Hiroshi Inoue
On 2017/08/17 12:54, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh[attachment "simple_t.c" deleted by Asif Shaikh/India/IBM]
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 03:21 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
Attached is a sample test program.
regards,
Hiroshi Inoue
On 2017/08/17 12:54, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh[attachment "simple_t.c" deleted by Asif Shaikh/India/IBM]
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, isreturning wrong count in SQLRowCount
From
"Asif Shaikh"
Date:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 03:21 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
Attached is a sample test program.
regards,
Hiroshi Inoue
On 2017/08/17 12:54, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh[attachment "simple_t.c" deleted by Asif Shaikh/India/IBM]
When you tried, did you connect to Amazon redshift using the postgre driver?
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 03:21 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
Attached is a sample test program.
regards,
Hiroshi Inoue
On 2017/08/17 12:54, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for replying.
Can you please share your simple test program.
I will try it at my end too because with my program it is giving me issues.
I will try to build a simple test program too using my odbctest utility which I can share with you.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 09:14 AM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/16 17:40, Asif Shaikh wrote:
Hi,
I am Asif from IBM and need an urgent help on following.
We are facing an issue with postgre driver(9.06.04.00) connecting to Amazon Redshift database.
We are executing the following query
SELECT DISTINCT customer_id INTO <New_Table_NAME>FROM <Existing_Table_Name>.
The query gets executed properly and the table also gets created.
The problem here is that postgre driver returns wrong count(affected number of rows) for this query as output paramter in SQLRowCount.
The sequence of driver calls are as follows
1. SQLDriverConnect - to connect to driver
2. SQLGetInfo (hDBC, SQL_ODBC_API_CONFORMANCE, (PTR)&confLevel, sizeof(confLevel), NULL); - To get the conformance level of database.
3. SQLGetInfo(hDBC, SQL_CURSOR_COMMIT_BEHAVIOR, (PTR)&cursorCB, sizeof(cursorCB), NULL); - To get the commit behavior for database.
4. SQLGetInfo(hDBC, SQL_TXN_CAPABLE, (PTR)&txnSupport, sizeof(txnSupport), NULL); - To get the transaction support information for database.
5. SQLGetInfo(hDBC, SQL_MAX_CONCURRENT_ACTIVITIES, (PTR)&iMaxConcurrent, sizeof(iMaxConcurrent), NULL); - To get the maximum concurrent statement information
The output of above 4 commands is as below(mentioned in bold). These may not be important for this question but mentioning it just in case if any output has any relation with the issue we are facing.
Server <DSN NAME> conforms to LEVEL 1.
Server's cursor commit behavior: PRESERVE
Transactions supported: ALL
Maximum number of concurrent statements: 0
6.
6. Finally the following query is executed using SQLExecDirect
SELECT DISTINCT customer_id INTO <New_Table_NAME> FROM <Existing_Table_Name>.
7. After executing this query, we check SQLNumResultCols(hStmt, &nResultCols); In this case, the result count is 0 which is expected as its not a normal select query.
8. Finally we call SQLRowCountAPI which doesn't modify the rowcount variable passed to it as output parameter whereas the same variable gets the correct value stored for other databases which supports such statement e.g. SQL server or even for update/insert this works fine.
I get an expected result here in a simple test program.
regards,
Hiroshi Inoue
9.
Because of this wrong count, our product is facing some blocking issues and it is delaying our release.
The above driver calls sequence is from our general tool for odbc connection test using which also we could reproduce the issue.
Our applications including the odbc connection tester are 64 bit applications and we are facing this issue on Windows, RHEL and AIX
Please help us rectify the issue asap.
Thanks & Regards
Asif G. Shaikh[attachment "simple_t.c" deleted by Asif Shaikh/India/IBM]
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift,is returning wrong count in SQLRowCount
From
"Inoue, Hiroshi"
Date:
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, isreturning wrong count in SQLRowCount
From
"Asif Shaikh"
Date:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift,is returning wrong count in SQLRowCount
From
"Inoue, Hiroshi"
Date:
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, isreturning wrong count in SQLRowCount
From
"Asif Shaikh"
Date:
Hi Hiroshi Inoue,
Can you please help me understand where can I find Mylog output for my test.
I could not go to office today as I am still not quite well. I will check with my team member tomorrow about how the old driver worked for him.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/18/2017 07:54 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Can you please help me understand where can I find Mylog output for my test.
I could not go to office today as I am still not quite well. I will check with my team member tomorrow about how the old driver worked for him.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/18/2017 07:54 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift,is returning wrong count in SQLRowCount
From
"Inoue, Hiroshi"
Date:
Hi,
If you can edit connection strings, please add *;debug=1* to the connection string.
On Windows You can find mylog_xxxxxx.log under root directory after execution.
regards,
Hiroshi Inoue
On 2017/08/21 17:21, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Can you please help me understand where can I find Mylog output for my test.
I could not go to office today as I am still not quite well. I will check with my team member tomorrow about how the old driver worked for him.
If you can edit connection strings, please add *;debug=1* to the connection string.
On Windows You can find mylog_xxxxxx.log under root directory after execution.
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/18/2017 07:54 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, isreturning wrong count in SQLRowCount
From
"Asif Shaikh"
Date:
Hi Hiroshi Inoue,
PFA, my test run logs.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/21/2017 02:20 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/21 17:21, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Can you please help me understand where can I find Mylog output for my test.
I could not go to office today as I am still not quite well. I will check with my team member tomorrow about how the old driver worked for him.
If you can edit connection strings, please add *;debug=1* to the connection string.
On Windows You can find mylog_xxxxxx.log under root directory after execution.
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/18/2017 07:54 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
PFA, my test run logs.
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/21/2017 02:20 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/21 17:21, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Can you please help me understand where can I find Mylog output for my test.
I could not go to office today as I am still not quite well. I will check with my team member tomorrow about how the old driver worked for him.
If you can edit connection strings, please add *;debug=1* to the connection string.
On Windows You can find mylog_xxxxxx.log under root directory after execution.
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/18/2017 07:54 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue
From: Asif Shaikh/India/IBM
To: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 05:48 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi Hiroshi Inoue,
I see the same error with the code you sent.
Did you build your application for 64 bit and used 64 bit postgre driver(9.06.04.00) ?
Thanks & Regards
Asif G. Shaikh
Attachment
Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift,is returning wrong count in SQLRowCount
From
"Inoue, Hiroshi"
Date:
Hi,
Thanks.
At first glance, the response from the server is different. unfortunately
in the log you sent, I see the following.
send_query: ok - 'C' - SELECT
send_query: setting cmdbuffer = 'SELECT'
In the log for my local server I see the following.
send_query: ok - 'C' - SELECT 3
send_query: setting cmdbuffer = 'SELECT 3'
regards,
Hiroshi Inoue
On 2017/08/21 21:03, Asif Shaikh wrote:
Hi Hiroshi Inoue,
PFA, my test run logs.
Thanks.
At first glance, the response from the server is different. unfortunately
in the log you sent, I see the following.
send_query: ok - 'C' - SELECT
send_query: setting cmdbuffer = 'SELECT'
In the log for my local server I see the following.
send_query: ok - 'C' - SELECT 3
send_query: setting cmdbuffer = 'SELECT 3'
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/21/2017 02:20 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
Hi,
On 2017/08/21 17:21, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Can you please help me understand where can I find Mylog output for my test.
I could not go to office today as I am still not quite well. I will check with my team member tomorrow about how the old driver worked for him.
If you can edit connection strings, please add *;debug=1* to the connection string.
On Windows You can find mylog_xxxxxx.log under root directory after execution.
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/18/2017 07:54 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/18 22:47, Asif Shaikh wrote:
Hi Hiroshi Inoue,
Thanks for the reply and I am sorry for replying late on this.
Actually I was on a sick leave today.
Your statement :-
I see the result * SQLRowCount=2 * here.
--> Yes, this looks to be correct count. In my case, the variable rowc doesn't get any value and still holds the initial value which is -1 in your test program.
One of my team member informed me that he tried the 8.02.05 driver with our application on RHEL and that actually worked whereas the driver 9.06.04 didn't work on the same setup.
So based on what I understood from his that the driver 9.06.04 is not working for him whereas the old driver 8.02.05 works.
Unfortunately, I could not get all the details on this. I will get all the details on this on Monday and will get back to you.
Meanwhile, is it possible for you to test your sample program with driver 9.06.04 to connect to Amazon redshift db and see if that reproduces the issue for you too?
Could take Mylog output of your test and send it to me directly?
regards,
Hiroshi Inoue
Thanks & Regards
Asif G. Shaikh
From: "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
To: Asif Shaikh <asif.shaikh@in.ibm.com>
Cc: pgsql-odbc@postgresql.org
Date: 08/17/2017 06:53 PM
Subject: Re: [ODBC] Postgre driver(9.06.04.00) connected to Amazon redshift, is returning wrong count in SQLRowCount
On 2017/08/17 21:30, Asif Shaikh wrote:
I just built your code on 32 bit and used the 32 bit postgre driver(8.02.05) but still it gave me same issue. :-(
When you tried, did you connect to Amazon redshift using the postgre driver?
I see the result * SQLRowCount=2 * here.
Isn't it an expected result?
Anyway I am testing with my local server
The server's response to the command *select .. into .. from ..* is *SELECT 2*.
If the response of Amazon redshift is different, the driver does nothing.
regards,
Hiroshi Inoue