Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1syCAH-00F103-Bc for pgadmin-hackers@arkaria.postgresql.org; Tue, 08 Oct 2024 15:30:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1syCAF-009kQq-LQ for pgadmin-hackers@arkaria.postgresql.org; Tue, 08 Oct 2024 15:30:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1syCAF-009kQL-Dr for pgadmin-hackers@lists.postgresql.org; Tue, 08 Oct 2024 15:30:19 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1syCAB-003AJg-5B for pgadmin-hackers@postgresql.org; Tue, 08 Oct 2024 15:30:17 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3e039889ca0so3537687b6e.3 for ; Tue, 08 Oct 2024 08:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1728401414; x=1729006214; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xpcYOsJiB3pPtlWDSTLYHPJZLRMuoI1EiTCJXsY3YSI=; b=UiDHWExdkSSmBRNQY8v26ojMeRRyL2h4LrGPP0zj3o1b8NfAeB1fI9p04b+PKiEnR4 2BvuCxsXn50/JBcDZqBZDcsS8p/3GTNJP4rkzRDgqW1jIzs1RpmM+HtqofoqkyT9XL66 F75MSp7SbHzH3Ho6NXqicJEGfWHIDK3ETFieQf3GWAvPfSc9GFFcn2/YMznTrR4P0UcX y02VsCiLDY7Q6s6bh6x13nAc1CrUs2VRKyBRYxpQ3Wdb9MG80UOJVpoPFJQf7E330iHo p1W0Rx/dmzE7exOE73VkRrcid0MTsHteW4rk5kGS4lZUaPgyoJ7kVLML5Uu/rTESOgTv mJEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728401414; x=1729006214; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xpcYOsJiB3pPtlWDSTLYHPJZLRMuoI1EiTCJXsY3YSI=; b=FWI2joRDJB46vh7V7/lVuuZjXu6qCXOz7RdS7jrQvXTl5BrmtlPcPeiNRVmDEG+mFo SNOIc0+3sLxY+YO1NVrNwo4gCjijPQO/4oT3Ff1qRG7T+2Dtwk/+US/O3O5iypmz+nq0 Nhq03xkpv3SPNtSGR37dTuhvWDenjVKSiDZLWIeyI4sPO0wNX2RWwsZ5t3mBOeY/VGnj OS/lM8apmVLVOj9BadMkA3Kdfkd/GIl2ihZiWZiUvt0O5PvfCBjdF6Kr2mQxB/3LVOrp /VUjPrJ4GttXWWtdHlpMHShSiloj5qc2gXE6/yaREM79q63wmlKa3S8S7knGMqw9ANVo PhNg== X-Gm-Message-State: AOJu0Yz092PgEaZI4T+C0waNKl7YlwMYCxYn8fft7c8ZIW2YKpFH8TJ+ 6ygj7cidFt3f8g8cKjmf9BCCrisi/x4VJ8c7V02+bNM5Z1EbJZPmYcTOEyDwlc479ZW7Rqi1g7Y UIvxX4CCioAM3LnjWHQvZTRbHxh4W//dVIPc3OCuAosHPgns= X-Google-Smtp-Source: AGHT+IElMTYYCJvWi2Es204XNWSl5Cj843W/8j99W28zoBymL88X0KLhxhOj7mLAX/m45hVZ9uOkm+Yy4PVlMKa2yiU= X-Received: by 2002:a05:6871:5296:b0:25e:fb:af8c with SMTP id 586e51a60fabf-287c1e7be27mr11842887fac.18.1728401414262; Tue, 08 Oct 2024 08:30:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pravesh Sharma Date: Tue, 8 Oct 2024 21:00:03 +0530 Message-ID: Subject: Re: Require suggestion for issue #8007 To: Dave Page Cc: pgadmin-hackers@postgresql.org Content-Type: multipart/alternative; boundary="00000000000053cfb40623f8d036" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000053cfb40623f8d036 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Dave, On Tue, Oct 8, 2024 at 6:34=E2=80=AFPM Dave Page wrote: > > > On Tue, 8 Oct 2024 at 13:56, Pravesh Sharma < > pravesh.sharma@enterprisedb.com> wrote: > >> Hi Hackers, >> >> We have been working on issue #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, i= t >> 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 > > --00000000000053cfb40623f8d036 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Dave,

On Tue, Oct 8, 2024 at 6:34= =E2=80=AFPM Dave Page <dpage@pgadmin.org> wrote:


On Tue, 8 Oct 2024 at 13:56, Pravesh Sharma &= lt;pra= vesh.sharma@enterprisedb.com> wrote:

Hi Hackers,

We have been working on issue #8007. After our analy= sis, 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 de= bugger, 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 i= s treated as a character (1) (character of length 1). For example, the outp= ut of=C2=A0SELECT 'pgadmin', 'pgadmin'::= character;=C2=A0is different.

There are two solutions we can consider:

  1. Do not typecast if the data type is character.
  2. Typecast= to=C2=A0varchar=C2=A0when the data = type is character.
Please provi= de 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?
--
<= /div>
--00000000000053cfb40623f8d036--