Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUDMc-0008KJ-0s for pgadmin-hackers@arkaria.postgresql.org; Mon, 01 Aug 2016 13:34:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bUDMb-0005O8-G5 for pgadmin-hackers@arkaria.postgresql.org; Mon, 01 Aug 2016 13:34:37 +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 1bUDMN-0004o9-Fn for pgadmin-hackers@postgresql.org; Mon, 01 Aug 2016 13:34:23 +0000 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bUDMG-0008Ht-MC for pgadmin-hackers@postgresql.org; Mon, 01 Aug 2016 13:34:22 +0000 Received: by mail-qt0-x236.google.com with SMTP id x25so104196886qtx.2 for ; Mon, 01 Aug 2016 06:34:16 -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=G/tLiykV4VYnx9FKP2oeG5FLk2tLLxQ78x8S7OZLt+o=; b=oa2jte3rbLEHaXl35MqSDIM+9ZAKK/i85wcpJUGn1VzNwBb3YYpJv2uWBk6soldWh8 v1x3/BjyPPCm9m/EiGSArU960UPU+UxkAXd3bDlIrPmlUAPuZ+v/GpmRh1fIAF7YXq04 RTsMyUuAQ6mtdexdXonxfSkqc3MDHTufwBM4sIgeDMRO2A4s1l29qfC3FZryQp9HGKzZ Sc8DEOMydCMopQOOC0RRNq4dVplmoeuveKDk5e4wLsNJ58IofcsEDD/81XfrW6M+/+/A rI20yaalSj5nJ1WiKnvNW5ElwIhvy4ue4L98g3+/0JSXmML7ScJVMheK6JCRv9OrrxBy jo+Q== 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=G/tLiykV4VYnx9FKP2oeG5FLk2tLLxQ78x8S7OZLt+o=; b=FosNmW5/TcM8xdv30fNQqyynvyDmCryYf938hMEKQzKuryErOto5jSbCScTqfXzJT2 y8M5G+Oc0HbimU/t5xzU2G78dq+eCqIUkJzSy+8JySJuOVqzLJT3GT2cIgTO66yk/6j6 BaBM+ZZEqHImkN6naOa5V+9lU7M3Upi5Kb3841OAN5jADKCCeJThQ5uNVMbSpyNvdwX3 ivpsKaJ6A4CT2Mqxt8g7J8R+xBBNaytl86ImUUqp6AyzAesAO2lTUImX29z2KIW6/MWi 8ziTV/fHqRCBtivS4i0lsXUf/vYqSJS370wzUYq6dGUVRLdQGvge9yDzMMb6XBR1HFCy pdfw== X-Gm-Message-State: AEkooutw54rQjvMxRWf+3dgTKlx1Gf5d2SwecV+4w5BgmpBdp3sbwCuRD0Iz5h0kIuoZXpXowkO99yANkV61Fl2M X-Received: by 10.200.34.221 with SMTP id g29mr93605866qta.2.1470058455629; Mon, 01 Aug 2016 06:34:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.8.3 with HTTP; Mon, 1 Aug 2016 06:33:55 -0700 (PDT) In-Reply-To: References: From: Murtuza Zabuawala Date: Mon, 1 Aug 2016 19:03:55 +0530 Message-ID: Subject: Re: PATCH: Encoding issue with qtLiteral function (pgAdmin4) To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a113f46400c14b4053902a815 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 --001a113f46400c14b4053902a815 Content-Type: text/plain; charset=UTF-8 Hi Dave, We have to added it because postgres format_type() function do not provide us type with 'public' schema prefix to it, due to which wrong SQL's are getting generated. Rest other types are pre fixed with their respective schema as required. Thanks, Murtuza -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Mon, Aug 1, 2016 at 6:51 PM, Dave Page wrote: > Hi > > On Thu, Jul 28, 2016 at 10:56 AM, Murtuza Zabuawala > wrote: > > Hi Dave, > > > > PFA updated patch to fix issue in functions which was due to improper > > handing of nested quoting of types in templates. > > I also fixed it in Table/Column node. > > > > Please review. > > This doesn't seem right to me: > > # If schema is not pg_catalog & then add schema > if row['nspname'] != 'pg_catalog' \ > and row['nspname'] == 'public': > rtn_type = row['nspname'] + "." + row['typname'] > else: > rtn_type = row['typname'] > > Shouldn't the "and row['nspname'] == 'public'" be removed? > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --001a113f46400c14b4053902a815 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave,

We have to added it because po= stgres format_type() function do not provide us type with 'public' = schema prefix to it, due to which wrong SQL's are getting generated.
Rest other types are pre fixed with their respective schema as = required.


Thanks,
Murtuza= =C2=A0


<= div dir=3D"ltr">--
Regards,
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enterprisedb.com
The Enterprise PostgreSQL Comp= any


On Mon, Aug 1, 2016 at 6:51 PM, Dave Page <= dpage@pgadmin.org> wrote:
H= i

On Thu, Jul 28, 2016 at 10:56 AM, Murtuza Zabuawala
<murtuza.zabuawala= @enterprisedb.com> wrote:
> Hi Dave,
>
> PFA updated patch to fix issue in functions which was due to improper<= br> > handing of nested quoting of types in templates.
> I also fixed it in Table/Column node.
>
> Please review.

This doesn't seem right to me:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # If schema is not = pg_catalog & then add schema
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if row['nspname= '] !=3D 'pg_catalog' \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 and row['nspname'] =3D=3D 'public':
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rtn_t= ype =3D row['nspname'] + "." + row['typname']
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rtn_t= ype =3D row['typname']

Shouldn't the "and row['nspname'] =3D=3D 'public'&= quot; be removed?

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

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

--001a113f46400c14b4053902a815--