Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO2CH-0003MD-LR for pgadmin-hackers@arkaria.postgresql.org; Fri, 15 Jul 2016 12:26:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bO2CF-0005Kk-S8 for pgadmin-hackers@arkaria.postgresql.org; Fri, 15 Jul 2016 12:26:23 +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 1bO2CE-0005Ic-5h for pgadmin-hackers@postgresql.org; Fri, 15 Jul 2016 12:26:22 +0000 Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bO2CA-0006lY-Ii for pgadmin-hackers@postgresql.org; Fri, 15 Jul 2016 12:26:20 +0000 Received: by mail-qk0-x236.google.com with SMTP id o67so99513997qke.1 for ; Fri, 15 Jul 2016 05:26:18 -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=nIiAFOHpg9XqqrXN/KlePpNkMqIKZz/RvTj2WtV7/rc=; b=BiNSVZSXILyiBaqpjhpd9cfnVUQ5cUC6zInuO/h5UDKyGg6KOg0OTXR4BKtsSUWr4e uDdbM80hr+SkyBLHeWwHEvthrjalE5cDtNjUKNBvKsCjbG+D/EDZO6hoDmDG2YkSIgkP Oa8q9HuNJC300ioULAHgDJlwUXsCHxgmlxsCMYO6lbZ5rGBTui/ruTD/kFAR8ZzvXei3 lw8bcDpyQgyDzly3hh4FhGlKAlK6wrkYjoqbEaaeXzrLkSy5MPqhb264rC7ANbL23tHw WijhaTn62/ckZw+KLSqOmbIlzvdf8E5HaWsasyMY+ch07cRKsnIFRPsh/dCwpGid6qJA oHTA== 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=nIiAFOHpg9XqqrXN/KlePpNkMqIKZz/RvTj2WtV7/rc=; b=lYFXTtlR3LuXainWAUuZhT2ebPe7Gztb5BZRA6pg7VlquiaqxguKas3p/p1zgE+LXt 33IuSKSEB83cNGQBFQbi3r9Ucepo3BNucuA/noRmfQtQEZNzbEJMrJEOG1HP3Zh0jVpB bMA5nJz3hW6I3vbVv4T6AbMV8arDz+e4RjVqkCQIhnhOMpwYvKCQH+B0TRJwJ9E7coVP G702txW8hlgg85ZXu5xH9Vvy0tH5/qjc/qz8t3UB3v4Hy8z65sZtO2FQxHKLuWN46Fp6 YsAPts59cou5Rfg5xLWYV5warQwI0LGFoKwcncSQpbkbTM42qwKqPcH9eJRrcWP/04Zf A42g== X-Gm-Message-State: ALyK8tJj+Emzsq3ERJCNkZyaDBPZ+eRFxRe6IYdwQlrZhaEaQbTTKC1kUQfRZzfYUlZZtmv1nEPNq48SRO8ZQ+2X X-Received: by 10.55.188.198 with SMTP id m189mr23865124qkf.134.1468585577180; Fri, 15 Jul 2016 05:26:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.8.3 with HTTP; Fri, 15 Jul 2016 05:25:57 -0700 (PDT) In-Reply-To: References: From: Murtuza Zabuawala Date: Fri, 15 Jul 2016 17:55:57 +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=94eb2c048d24a6a9580537abb986 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 --94eb2c048d24a6a9580537abb986 Content-Type: text/plain; charset=UTF-8 On Fri, Jul 15, 2016 at 5:27 PM, Dave Page wrote: > OK, so the type names are affected by the duplicate column names, and > need to be avoided by using indexes and avoiding dicts. That's issue > #1409. > > The second issue is that "SELECT CURRENT_TIMESTAMP" gives us "now > timestamp with time zone (8)". Is the (8) also part of issue #1409, or > some other bug? > > (I though it's by design that we are displaying size with every column) But this is not related to RM#1409 or RM#1438. > The third issue is fixed by this patch, so I'll commit that as there's > a ticket for the other bit already). > > On Fri, Jul 15, 2016 at 12:49 PM, Murtuza Zabuawala > wrote: > > ++ 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 > > 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 > >> > >> > > > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --94eb2c048d24a6a9580537abb986 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Fri, Jul 15, 2016 at 5:27 PM, Dave Page <= span dir=3D"ltr"><dpage@pgadmin.org> wrote:
= OK, so the type names are affected by the duplicate column names, and
need to be avoided by using indexes and avoiding dicts. That's issue #1409.

The second issue is that "SELECT CURRENT_TIMESTAMP" gives us &quo= t;now
timestamp with time zone (8)". Is the (8) also part of issue #1409, or=
some other bug?

(I though it's by design that we are displaying s= ize with every column)
But this is not related to RM#1409 or RM#1= 438.
=C2=A0=C2=A0
The third issue is fixed by this patch, so I'll commit that as there= 9;s
a ticket for the other bit already).

On Fri, Jul 15, 2016 at 12:49 PM, Murtuza Zabuawala
<murtuza.zabuawala= @enterprisedb.com> wrote:
> ++ FYI,
>
> If you provide alias, it'll give you proper result :)
>
> SELECT CURRENT_TIMESTAMP as ts, CAST ( CURRENT_TIMESTAMP AS text ) as<= br> > 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.zabu= awala@enterprisedb.com> wrote:
>>
>> Hi Dave,
>>
>> Yes, I am aware of that, but the issue you mentioned is due to psy= copg2
>> DictCursor issue which I have already mentioned earlier (RM#1409)<= br> >> https://github.com/psycopg/psycopg2/issues/45= 4.
>>
>> 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 <dpage@pgadmin.org> wrote:
>>>
>>> On Thu, Jul 14, 2016 at 10:06 AM, Murtuza Zabuawala
>>> <murt= uza.zabuawala@enterprisedb.com> wrote:
>>> > Hi,
>>> >
>>> > PFA patch to fix the issue where if user use cast functio= n 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&qu= ot;
>>>
>>> Note that SELECT CURRENT_TIMESTAMP also gets this a little wro= ng - it
>>> shows "now timestamp with time zone(8)" (the size sh= ouldn't be
>>> included)
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>
>>
>



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

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

--94eb2c048d24a6a9580537abb986--