Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO1dE-0000aV-UU for pgadmin-hackers@arkaria.postgresql.org; Fri, 15 Jul 2016 11:50:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bO1dE-0000dW-Gp for pgadmin-hackers@arkaria.postgresql.org; Fri, 15 Jul 2016 11:50:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bO1d1-0000Nz-IW for pgadmin-hackers@postgresql.org; Fri, 15 Jul 2016 11:49:59 +0000 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bO1cy-0005vQ-0A for pgadmin-hackers@postgresql.org; Fri, 15 Jul 2016 11:49:58 +0000 Received: by mail-qk0-x229.google.com with SMTP id p74so98701452qka.0 for ; Fri, 15 Jul 2016 04:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4dwLGRotRFkZoxGW5lEdWW1qLKptprjhPD2p56sNcug=; b=BF2IW91AD7hfa24fXFzEx/MkSca5NKK0lTcjXDX6dV2dVXW5AMvmCv7g/bST1T95G6 8XgJaRI7UwiSHb67P3uA6GzvO1tglt+C969R8XcPtodNY+lc+3UinbGJE8QxEQtC83D1 yoUyw1VALqVpFHt0+ISn/llzoIdJD0BhvmgIOOSfe7eJbj6Q17WIWOC9P/OewH5S8Ens HoNiRIxDt0VfzprACYrap8R/0A/LtCYlBe/6HdxRm1/avCmEZfLnjmA6aqCeFO4IcrBO 8ealzenLXG9Kg+hxn5RIGImqewzETmwJwYSVrjN8EIxxuZjeKp55AH9XqnC+hQA4UnzU ppVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4dwLGRotRFkZoxGW5lEdWW1qLKptprjhPD2p56sNcug=; b=dSwY4+Kpf15Kfu89vR/Pc2kE/8ocXkWLlSkHnpz3edRNVR8boWK7y9ymxsxqhVE7Qt F3kCwerNYwO9Mw6kdxX6oovjdyvMqT8aN89+vgG808ppmXCjCteSLzgGY4+JhwTRYymE 6+z7GZiSk0/F27837URPvwgzLYNKdaH5+o/psh/dRDC/+4KHwkM+qWzA2+zvRgc8HRaL 6qatIR/wxgK/yVv+jMPQFghOoVCUcRx1GKrnTy2FkczMISUifasJMtisJa2HkeFwfE6Q ODne7qAGetkI2Nrb8jiS/CROKkurpbbwMKL8ytc7XQYkp7J/9tgM5LxCY9sozdNVv/sU /yKw== X-Gm-Message-State: ALyK8tJ+GtkQE6T0kFF0Lu0aPbSgcg64OBMgFcKoimY0OA/PTzi/rxHkjhrGRACl9XmoB85g/eB0NZDKE739EW3P X-Received: by 10.55.159.87 with SMTP id i84mr25697765qke.115.1468583394742; Fri, 15 Jul 2016 04:49:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.8.3 with HTTP; Fri, 15 Jul 2016 04:49:35 -0700 (PDT) In-Reply-To: References: From: Murtuza Zabuawala Date: Fri, 15 Jul 2016 17:19:35 +0530 Message-ID: Subject: Re: PATCH: To fix the issue where cast function causes freeze (pgAdmin4) To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a114d31b0912e770537ab3787 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a114d31b0912e770537ab3787 Content-Type: text/plain; charset=UTF-8 ++ FYI, If you provide alias, it'll give you proper result :) SELECT CURRENT_TIMESTAMP as ts, CAST ( CURRENT_TIMESTAMP AS text ) as ts_as_text; -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Fri, Jul 15, 2016 at 5:14 PM, Murtuza Zabuawala < murtuza.zabuawala@enterprisedb.com> wrote: > Hi Dave, > > Yes, I am aware of that, but the issue you mentioned is due to psycopg2 > DictCursor issue which I have already mentioned earlier (RM#1409) > https://github.com/psycopg/psycopg2/issues/454. > > The patch is for different issue (RM#1438). > > -- > Regards, > Murtuza Zabuawala > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > On Fri, Jul 15, 2016 at 4:37 PM, Dave Page wrote: > >> On Thu, Jul 14, 2016 at 10:06 AM, Murtuza Zabuawala >> wrote: >> > Hi, >> > >> > PFA patch to fix the issue where if user use cast function and it causes >> > freeze in query tool. >> > (RM#1438) >> >> This fixes the hang, but then displays the wrong data type for the >> first column - e.g. >> >> SELECT CURRENT_TIMESTAMP, CAST ( CURRENT_TIMESTAMP AS text ) ; >> >> will show the columns as "now text(8)" and "now text", when it should >> be "now timestamp with time zone", "now text" >> >> Note that SELECT CURRENT_TIMESTAMP also gets this a little wrong - it >> shows "now timestamp with time zone(8)" (the size shouldn't be >> included) >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > > --001a114d31b0912e770537ab3787 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
++ FYI,

If you provide alias, it'll= give you proper result :)

SELECT CURRENT_TIMESTAMP as ts, CAST ( CURRENT_TIMESTAMP AS text = ) as ts_as_text;


--
<= font color=3D"#888888">Murtuza Zabuawala
EnterpriseDB:=C2=A0<= a href=3D"http://www.enterprisedb.com/" rel=3D"noreferrer" style=3D"color:r= gb(17,85,204)" target=3D"_blank">http://www.enterprisedb.com
The Ente= rprise PostgreSQL Company

On Fri, Jul 15, 2016 at 5:14 PM, Murtuza Zab= uawala <murtuza.zabuawala@enterprisedb.com>= wrote:
Hi Dave,
Yes, I am aware of that, but the issue you mentioned is due to = psycopg2 DictCursor issue which I have already mentioned earlier (RM#1409)= =C2=A0https://github.com/psyc= opg/psycopg2/issues/454.

The patch is for diff= erent issue (RM#1438).

=
--=
Regards,
Murtuza Zabuawala
Enterpri= seDB:=C2=A0http://www.enterprisedb= .com
The Enterprise PostgreSQL Company


On Fri, Jul 15, 2016 at 4:37 PM, Dave Page <= span dir=3D"ltr"><dpage@pgadmin.org> wrote:
= On Thu, Jul 14, 2016 at 10:06 AM, Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
> Hi,
>
> PFA patch to fix the issue where if user use cast function and it caus= es
> freeze in query tool.
> (RM#1438)

This fixes the hang, but then displays the wrong data type for the
first column - e.g.

SELECT CURRENT_TIMESTAMP, CAST ( CURRENT_TIMESTAMP AS text ) ;

will show the columns as "now text(8)" and "now text", = when it should
be "now timestamp with time zone", "now text"

Note that SELECT CURRENT_TIMESTAMP also gets this a little wrong - it
shows "now timestamp with time zone(8)" (the size shouldn't b= e
included)


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--001a114d31b0912e770537ab3787--