public inbox for [email protected]help / color / mirror / Atom feed
Require suggestion for issue #8007 4+ messages / 2 participants [nested] [flat]
* Require suggestion for issue #8007 @ 2024-10-08 12:56 Pravesh Sharma <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Pravesh Sharma @ 2024-10-08 12:56 UTC (permalink / raw) To: pgadmin-hackers Hi Hackers, We have been working on issue #8007 <https://github.com/pgadmin-org/pgadmin4/issues/8007;. After our analysis, we found that the length and scale of the argument's data type are not stored in the database server, making it difficult to fetch. In the debugger, pgAdmin typecasts the provided value to its data type when calling the function, which is causing the issue. If we typecast the value to a character without specifying the length, it is treated as a character (1) (character of length 1). For example, the output of SELECT 'pgadmin', 'pgadmin'::character; is different. There are two solutions we can consider: 1. Do not typecast if the data type is character. 2. Typecast to varchar when the data type is character. Please provide your suggestions which solution looks good to you. Thanks, Pravesh -- Pravesh Sharma Software Engineer +91 9406461406 enterprisedb.com ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Require suggestion for issue #8007 @ 2024-10-08 13:04 Dave Page <[email protected]> parent: Pravesh Sharma <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Dave Page @ 2024-10-08 13:04 UTC (permalink / raw) To: Pravesh Sharma <[email protected]>; +Cc: pgadmin-hackers On Tue, 8 Oct 2024 at 13:56, Pravesh Sharma <[email protected]> wrote: > Hi Hackers, > > We have been working on issue #8007 > <https://github.com/pgadmin-org/pgadmin4/issues/8007;. After our > analysis, we found that the length and scale of the argument's data type > are not stored in the database server, making it difficult to fetch. In the > debugger, pgAdmin typecasts the provided value to its data type when > calling the function, which is causing the issue. > > If we typecast the value to a character without specifying the length, it > is treated as a character (1) (character of length 1). For example, the > output of SELECT 'pgadmin', 'pgadmin'::character; is different. > > There are two solutions we can consider: > > 1. Do not typecast if the data type is character. > 2. Typecast to varchar when the data type is character. > > Please provide your suggestions which solution looks good to you. > Why not include the length in the cast? We know what the input string is, so can't we just do the equivalent of: 'pgadmin'::character(7); -- Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org EDB: https://www.enterprisedb.com ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Require suggestion for issue #8007 @ 2024-10-08 15:30 Pravesh Sharma <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Pravesh Sharma @ 2024-10-08 15:30 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers Hi Dave, On Tue, Oct 8, 2024 at 6:34 PM Dave Page <[email protected]> wrote: > > > On Tue, 8 Oct 2024 at 13:56, Pravesh Sharma < > [email protected]> wrote: > >> Hi Hackers, >> >> We have been working on issue #8007 >> <https://github.com/pgadmin-org/pgadmin4/issues/8007;. After our >> analysis, we found that the length and scale of the argument's data type >> are not stored in the database server, making it difficult to fetch. In the >> debugger, pgAdmin typecasts the provided value to its data type when >> calling the function, which is causing the issue. >> >> If we typecast the value to a character without specifying the length, it >> is treated as a character (1) (character of length 1). For example, the >> output of SELECT 'pgadmin', 'pgadmin'::character; is different. >> >> There are two solutions we can consider: >> >> 1. Do not typecast if the data type is character. >> 2. Typecast to varchar when the data type is character. >> >> Please provide your suggestions which solution looks good to you. >> > > Why not include the length in the cast? We know what the input string is, > so can't we just do the equivalent of: > > 'pgadmin'::character(7); > Just to confirm, this will be only for the character data type? > -- > Dave Page > pgAdmin: https://www.pgadmin.org > PostgreSQL: https://www.postgresql.org > EDB: https://www.enterprisedb.com > > ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Require suggestion for issue #8007 @ 2024-10-09 08:59 Dave Page <[email protected]> parent: Pravesh Sharma <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Dave Page @ 2024-10-09 08:59 UTC (permalink / raw) To: Pravesh Sharma <[email protected]>; +Cc: pgadmin-hackers On Tue, 8 Oct 2024 at 16:30, Pravesh Sharma <[email protected]> wrote: > Hi Dave, > > On Tue, Oct 8, 2024 at 6:34 PM Dave Page <[email protected]> wrote: > >> >> >> On Tue, 8 Oct 2024 at 13:56, Pravesh Sharma < >> [email protected]> wrote: >> >>> Hi Hackers, >>> >>> We have been working on issue #8007 >>> <https://github.com/pgadmin-org/pgadmin4/issues/8007;. After our >>> analysis, we found that the length and scale of the argument's data type >>> are not stored in the database server, making it difficult to fetch. In the >>> debugger, pgAdmin typecasts the provided value to its data type when >>> calling the function, which is causing the issue. >>> >>> If we typecast the value to a character without specifying the length, >>> it is treated as a character (1) (character of length 1). For example, the >>> output of SELECT 'pgadmin', 'pgadmin'::character; is different. >>> >>> There are two solutions we can consider: >>> >>> 1. Do not typecast if the data type is character. >>> 2. Typecast to varchar when the data type is character. >>> >>> Please provide your suggestions which solution looks good to you. >>> >> >> Why not include the length in the cast? We know what the input string is, >> so can't we just do the equivalent of: >> >> 'pgadmin'::character(7); >> > Just to confirm, this will be only for the character data type? > Yes, if that's the only type with which the issue is seen. -- Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org EDB: https://www.enterprisedb.com ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2024-10-09 08:59 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-10-08 12:56 Require suggestion for issue #8007 Pravesh Sharma <[email protected]> 2024-10-08 13:04 ` Dave Page <[email protected]> 2024-10-08 15:30 ` Pravesh Sharma <[email protected]> 2024-10-09 08:59 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox