Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSPP7-0000i8-T8 for pgadmin-hackers@arkaria.postgresql.org; Wed, 27 Jul 2016 14:01:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bSPP7-0006UU-Fc for pgadmin-hackers@arkaria.postgresql.org; Wed, 27 Jul 2016 14:01:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSPOu-00068m-0Y for pgadmin-hackers@postgresql.org; Wed, 27 Jul 2016 14:01:32 +0000 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bSPOq-0008HF-Vj for pgadmin-hackers@postgresql.org; Wed, 27 Jul 2016 14:01:31 +0000 Received: by mail-io0-x236.google.com with SMTP id b62so70822137iod.3 for ; Wed, 27 Jul 2016 07:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DbMqhalGLf87NTbzVH19cZ3JSe5+CkZQahoCXRsdSFM=; b=OuZ20rxnJPtHR7cz2dVIU4cUsGFBSXPOrs0nbRaK/M3FMAFPMtgdVuExazFWo3IjoG xk2SFzhK4ewqmMRZbgSghYiYNG93LEFak5b02r7zUhLeVPNGrA/3XxhxFgca3cG6836M WB+iOE7nN/VAKEb9oEE/lbZYfNzRjMcblOUkbztXIty0wZXp9tBcKYVd36qQDjjMhvHb U+wtVQbbaIL/+A6hBqSqn2aEA1RQ/fxzj0IeCBcGMxgNriq0VsWGQ5TO6fMsBjnCSmSk WVPQMm46pD+IyetC4gXKPM+SJXnmoUCWd7DxtA7uu1odYUmrJiT4O9INlzPUnfQd0kb1 610Q== 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=DbMqhalGLf87NTbzVH19cZ3JSe5+CkZQahoCXRsdSFM=; b=M5SahM654fW+958AeDbMmblutQlwSmeGbSFKvRWYYJFPiXH9FhQut39hLKw3U9ri7L H6YtDfs+Sc2DqL2UyLjgWpG2OqgBFojneZ/49ZBDkqOrthtVpMuqvUxpf9S/uA2QUi4S zhQ0pkaY+AH1r6rmy95OpNdCryhX9Uy9MjFN+I/YhtRJLAg99yQUZsHBLEukdjAXnhyz Hd0KJCP8nuWcTQQScfwZJyx3Xf5INtGjP3jIquoT1Q5knwwPpT2S/wjntzHg2t6zmxOu 0+WYUS+Bzrwucz4Ib8a/gRUTPmJVB2nR9C7bCeLo5pgqc2kJFfMS2BwJcp9Z5TiQUVxG CxYA== X-Gm-Message-State: AEkoouu2RetCHZSLz2rVM+RrjC+B6WQZ4jhW5F5e5WrGowXrDow9qrHqtODF8iVXsXvWBDQ7pYN/5fT6U44bqg== X-Received: by 10.107.183.85 with SMTP id h82mr33649107iof.63.1469628086585; Wed, 27 Jul 2016 07:01:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.25.136 with HTTP; Wed, 27 Jul 2016 07:01:25 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Wed, 27 Jul 2016 15:01:25 +0100 Message-ID: Subject: Re: PATCH: Encoding issue with qtLiteral function (pgAdmin4) To: Murtuza Zabuawala Cc: pgadmin-hackers Content-Type: text/plain; charset=UTF-8 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 Thanks - applied! On Wed, Jul 27, 2016 at 1:37 PM, Murtuza Zabuawala wrote: > Okay, Let me check on that. > > Meanwhile I'm attaching patch for making Provider optional in security > labels control. > > Regards, > Murtuza > > -- > Regards, > Murtuza Zabuawala > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > On Wed, Jul 27, 2016 at 5:04 PM, Dave Page wrote: >> >> Hi >> >> On Wed, Jul 27, 2016 at 12:18 PM, Murtuza Zabuawala >> wrote: >> > Hi Dave, >> > >> > 1) Unicode conversion was working properly for function node, It was >> > failing >> > due to wrong sql templates. >> > - I've fixed them. >> >> I just did a test, and it's still failing - see the attached >> screenshot. Aside from the encoding issue, it looks like it's adding >> extra quotes around the parameter data type - double-double quoting >> the schema and type, and then quoting the whole lot again in the >> CREATE part. The ALTER part looks fine. >> >> > 2) Type is also working fine with encoding for me(PFA screenshots), Can >> > you >> > please provide error you got? >> >> Hmm, I can't reproduce that now. Weird. >> >> > This patch also makes Provider optional in security label control & >> > templates. >> > >> > ------- >> > Regarding enforcing to utf-8, In my opinion we can enforce everything to >> > utf-8 if we use any of one python version but to make it compatible with >> > both python2 and python3 version by forcing utf-8 encoding it will be >> > difficult to handle its side effects. >> >> Urgh. Ok, thanks. >> >> > Python2, >> > >> >>>> txt_sample = 'Hello' >> >>>> isinstance(txt_sample, str) >> > True >> >>>> isinstance(txt_sample, bytes) >> > True >> >>>> isinstance(txt_sample, unicode) >> > False >> >>>> txt_sample.encode('utf-8') >> > 'Hello' >> >>>> txt_sample.decode('utf-8') >> > u'Hello' >> > >> > Forcing to unicode in Python2, >> > >> >>>> txt_sample = u'Hello' >> >>>> isinstance(txt_sample, str) >> > False >> >>>> isinstance(txt_sample, bytes) >> > False >> >>>> isinstance(txt_sample, unicode) >> > True >> > >> > Python3, >> > >> >>>> txt_sample = 'Hello' >> >>>> isinstance(txt_sample, str) >> > True >> >>>> isinstance(txt_sample, bytes) >> > False >> >>>> txt_sample.encode('utf-8') >> > b'Hello' >> >>>> txt_sample.decode('utf-8') >> > Traceback (most recent call last): >> > File "", line 1, in >> > AttributeError: 'str' object has no attribute 'decode' >> > >> > >> > And also psycopg2 driver returns text as string in Python2 even if that >> > text >> > contains unicode characters, In python3 that just works fine because >> > string >> > is Unicode by default. >> > >> > >> > Regards, >> > Murtuza >> > >> > -- >> > Regards, >> > Murtuza Zabuawala >> > EnterpriseDB: 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 > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers