Thread: [pgAdmin][Patch] RM 5463 - CSV download quotes numeric columns

[pgAdmin][Patch] RM 5463 - CSV download quotes numeric columns

From
Yogesh Mahajan
Date:
Hi,

Please find a patch which fixes the issue of quoting values of numeric data types like 'bigint, numeric, double precision & real'.

The issue was caused because global type caster are registered for connection in order to avoid javascript compatibility issue for large size data types like real, numeric, double precision, bigint.
Typcaster used to cast these data type values into String, causing quotes to numeric data in downloaded CSV files in case of  "CSV quoting = Strings".

As part of fix, type caster is temporarily unregistered for these numeric data types while creating CSV file & registered back after csv file creation.



Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709
Attachment

Re: [pgAdmin][Patch] RM 5463 - CSV download quotes numeric columns

From
Akshay Joshi
Date:
Hi Aditya

Can you please review it.

On Wed, Jul 8, 2020 at 4:17 PM Yogesh Mahajan <yogesh.mahajan@enterprisedb.com> wrote:
Hi,

Please find a patch which fixes the issue of quoting values of numeric data types like 'bigint, numeric, double precision & real'.

The issue was caused because global type caster are registered for connection in order to avoid javascript compatibility issue for large size data types like real, numeric, double precision, bigint.
Typcaster used to cast these data type values into String, causing quotes to numeric data in downloaded CSV files in case of  "CSV quoting = Strings".

As part of fix, type caster is temporarily unregistered for these numeric data types while creating CSV file & registered back after csv file creation.



Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246

Re: [pgAdmin][Patch] RM 5463 - CSV download quotes numeric columns

From
Aditya Toshniwal
Date:
Hi Yogesh,

The patch looks good to me except that the newly added import can be clubbed with the existing one.

+from psycopg2.extensions import DECIMAL as _DECIMAL

 import psycopg2

 from psycopg2.extensions import encodings


On Thu, Jul 9, 2020 at 1:24 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Aditya

Can you please review it.

On Wed, Jul 8, 2020 at 4:17 PM Yogesh Mahajan <yogesh.mahajan@enterprisedb.com> wrote:
Hi,

Please find a patch which fixes the issue of quoting values of numeric data types like 'bigint, numeric, double precision & real'.

The issue was caused because global type caster are registered for connection in order to avoid javascript compatibility issue for large size data types like real, numeric, double precision, bigint.
Typcaster used to cast these data type values into String, causing quotes to numeric data in downloaded CSV files in case of  "CSV quoting = Strings".

As part of fix, type caster is temporarily unregistered for these numeric data types while creating CSV file & registered back after csv file creation.



Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246


--
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

Re: [pgAdmin][Patch] RM 5463 - CSV download quotes numeric columns

From
Yogesh Mahajan
Date:
Hello,

Please find an updated patch with the above comment.

Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


On Thu, Jul 9, 2020 at 2:27 PM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Yogesh,

The patch looks good to me except that the newly added import can be clubbed with the existing one.

+from psycopg2.extensions import DECIMAL as _DECIMAL

 import psycopg2

 from psycopg2.extensions import encodings


On Thu, Jul 9, 2020 at 1:24 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Aditya

Can you please review it.

On Wed, Jul 8, 2020 at 4:17 PM Yogesh Mahajan <yogesh.mahajan@enterprisedb.com> wrote:
Hi,

Please find a patch which fixes the issue of quoting values of numeric data types like 'bigint, numeric, double precision & real'.

The issue was caused because global type caster are registered for connection in order to avoid javascript compatibility issue for large size data types like real, numeric, double precision, bigint.
Typcaster used to cast these data type values into String, causing quotes to numeric data in downloaded CSV files in case of  "CSV quoting = Strings".

As part of fix, type caster is temporarily unregistered for these numeric data types while creating CSV file & registered back after csv file creation.



Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246


--
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachment

Re: [pgAdmin][Patch] RM 5463 - CSV download quotes numeric columns

From
Akshay Joshi
Date:
Thanks, patch applied.

On Thu, Jul 9, 2020 at 3:25 PM Yogesh Mahajan <yogesh.mahajan@enterprisedb.com> wrote:
Hello,

Please find an updated patch with the above comment.

Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


On Thu, Jul 9, 2020 at 2:27 PM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Yogesh,

The patch looks good to me except that the newly added import can be clubbed with the existing one.

+from psycopg2.extensions import DECIMAL as _DECIMAL

 import psycopg2

 from psycopg2.extensions import encodings


On Thu, Jul 9, 2020 at 1:24 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Aditya

Can you please review it.

On Wed, Jul 8, 2020 at 4:17 PM Yogesh Mahajan <yogesh.mahajan@enterprisedb.com> wrote:
Hi,

Please find a patch which fixes the issue of quoting values of numeric data types like 'bigint, numeric, double precision & real'.

The issue was caused because global type caster are registered for connection in order to avoid javascript compatibility issue for large size data types like real, numeric, double precision, bigint.
Typcaster used to cast these data type values into String, causing quotes to numeric data in downloaded CSV files in case of  "CSV quoting = Strings".

As part of fix, type caster is temporarily unregistered for these numeric data types while creating CSV file & registered back after csv file creation.



Thanks,
Yogesh Mahajan
QA - Team
EnterpriseDB Corporation

Phone: +91-9741705709


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246


--
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246