Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU5GG-00012i-VL for pgadmin-hackers@arkaria.postgresql.org; Thu, 19 Jan 2017 05:27:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cU5GG-0005LL-F9 for pgadmin-hackers@arkaria.postgresql.org; Thu, 19 Jan 2017 05:27:48 +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 1cU5GF-0005L2-Fa for pgadmin-hackers@postgresql.org; Thu, 19 Jan 2017 05:27:47 +0000 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cU5G5-0001XO-VX for pgadmin-hackers@postgresql.org; Thu, 19 Jan 2017 05:27:46 +0000 Received: by mail-oi0-x230.google.com with SMTP id m124so19171719oif.1 for ; Wed, 18 Jan 2017 21:27:37 -0800 (PST) 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=tQqtyBV3ZrBrZh2hrKXin7EUj6/bewLHzLib19Kt2+Y=; b=d6nF9qkkgU5wce3RFLwyUHWgCNYesr+60yJFhZeSF8e0PHeJSEx115XwUu/6A4Tu9F D3cd6p4/KQiULzQqnS0vKTR+/CaIIYtq50c30xA55mjOOpM92/ags6FGfb6n5mZ+SEpU 0CJMGNj9lr7xsZ4dDXYoBYonWljRgXtX9CbR9ABbr4osnJh1JRpcuRHXExVoPGaMe7Sf N2tigLNsqpV1Xxrtm2ICyftdebyXLlqV8IJMZDO2M8QxOC9E09NRHz+GHAjddpRhHSoV D8dCJ4RYOpc2uVU7PlECxoTaqBcvzZRvY7Gm5Uluhiiol4T4kK0aIGXBya7h6qgsTJTH Zr+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tQqtyBV3ZrBrZh2hrKXin7EUj6/bewLHzLib19Kt2+Y=; b=iPfHAEmPRNsIOlJ7O9uNp+x34+DH2Xdow95F6Q7Y5CaW/gSfpDpx5VHzpq9li7zPwh Rq8SLv7xNpRl8+tqnYqtzbJ3iHO3TziFQSDic7rAxche9zRJRTmetupwP2tF3VOUtdDa 01PszKTe0v57sCWk/YrI5mOTaJJ2+5T3FAyhgYrz/FRHkDm8Euqw+SOcBTT7q7dZJATj y/ow1m8UKX+myuyXg9aHzI9L9HsoCEymwPXsXHHFlpAL6SrVVXa+wJELj1O6jgXOHgNu ncVGyV4TIdR6CWuGOcRdMp0nLCPiMUSSS/oLHBlmPQbEjOKqQDSRlmE78XgtoJjqMRv8 fmOg== X-Gm-Message-State: AIkVDXLuzRaHIIG9ZlP4Q6GfhfUqBoxdHAjAPf1eVR6/YHNRmhOMeTukG6FJqYCm176t6X7K/ZO27rbA9JV+gLcH X-Received: by 10.202.184.87 with SMTP id i84mr3635353oif.130.1484803657100; Wed, 18 Jan 2017 21:27:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.183.26.2 with HTTP; Wed, 18 Jan 2017 21:27:16 -0800 (PST) In-Reply-To: References: From: Murtuza Zabuawala Date: Thu, 19 Jan 2017 10:57:16 +0530 Message-ID: Subject: Re: pgadmin4.1.1 ERROR,22021,"invalid byte sequence for encoding ""UTF8"" To: Bhanu Gandikota Cc: "pgadmin-hackers@postgresql.org" Content-Type: multipart/alternative; boundary=001a113cd2208b02af05466bcaf6 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 --001a113cd2208b02af05466bcaf6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Can you run & provide output offollowing sql queries from pgAdmin4? - SHOW SERVER_ENCODING; - SHOW CLIENT_ENCODING; And what is the encoding set for your current database connection on which you are trying to run query (Right click on your database, click on Properties > Definition Tab > Check Encoding, Collation & Character type) ? -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Wed, Jan 18, 2017 at 9:15 PM, Bhanu Gandikota wrote: > Getting following error in PostgreSQL 9.6.1 DB logs when I tried to view = =E2=80=9C*Scripts=3D>CREATE > Script*=E2=80=9D on a table in PgAdmin4.1.1 Browser. > > PostgreSQL DB has been recently upgraded from version 9.3.9 to 9.6.1 usin= g > pg_upgrade utility. > > > > The same browser function worked just fine when pgadmin3 was pointing to > PostgreSQL 9.3.9 database (before upgrade). > > > > > > 2017-01-18 07:34:43.364 PST,"user","QA961",5423,"x.x. > x.x:64624",587f99b8.152f,4,"idle",2017-01-18 07:24:40 PST,2/92094,0,*ERRO= R,22021,"invalid > byte sequence for encoding ""UTF8"": 0x00",,,,,,"* > > SELECT t.oid,t.tgname AS name, t.xmin, t.*, relname, CASE WHEN relkind = =3D > 'r' THEN TRUE ELSE FALSE END AS parentistable, > > nspname, des.description, l.lanname, p.prosrc, p.proname AS tfunction= , > > COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE > PROCEDURE'), > > substring(pg_get_triggerdef(t.oid), 'WHEN (.*) \\$trigger')) AS > whenclause, > > -- We need to convert tgargs column bytea datatype to array datatype > > (string_to_array(encode(tgargs, 'escape'), > '\000')::text[])[1:tgnargs] AS tgargs, > > (CASE WHEN t.oid <=3D 13321::oid THEN true ElSE false END) AS > is_sys_trigger, > > (CASE WHEN tgconstraint !=3D 0::OID THEN true ElSE false END) AS > is_constarint, > > (CASE WHEN tgenabled =3D 'O' THEN true ElSE false END) AS > is_enable_trigger > > FROM pg_trigger t > > JOIN pg_class cl ON cl.oid=3Dtgrelid > > JOIN pg_namespace na ON na.oid=3Drelnamespace > > LEFT OUTER JOIN pg_description des ON (des.objoid=3Dt.oid AND > des.classoid=3D'pg_trigger'::regclass) > > LEFT OUTER JOIN pg_proc p ON p.oid=3Dt.tgfoid > > LEFT OUTER JOIN pg_language l ON l.oid=3Dp.prolang > > WHERE NOT tgisinternal > > AND tgrelid =3D 17452::OID > > AND t.oid =3D 18252::OID > > ORDER BY tgname;",,,"pgAdmin 4 - DB:QA961" > --001a113cd2208b02af05466bcaf6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

Can you run & provide outp= ut offollowing sql queries from pgAdmin4?
  • SHOW SERVER_ENC= ODING;
  • SHOW CLIENT_ENCODING;

=
And what is the encodi= ng set for your current database connection on which you are trying to run = query (Right click on your database, click on Properties > Definition Ta= b > Check Encoding, Collation & Character type) ?


--
Regards,
Murtuza Zabua= wala
EnterpriseDB:=C2=A0htt= p://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Wed, Jan 18, 2017 at 9:15 PM, Bhanu Gandi= kota <bgandikota@ebates.com> wrote:

Getting following e= rror in PostgreSQL 9.6.1 DB logs when I tried to view =E2=80=9CScripts=3D>CREATE Script=E2=80=9D on a table= in PgAdmin4.1.1 Browser.

PostgreSQL DB has b= een recently upgraded from version 9.3.9 to 9.6.1 using pg_upgrade utility.

=C2=A0

The same browser fu= nction worked just fine when pgadmin3 was pointing to PostgreSQL 9.3.9 data= base (before upgrade).

=C2=A0

=C2=A0

2017-01-18 07:34= :43.364 PST,"user","QA961",5423,"x.x.x.x:6462= 4",587f99b8.152f,4,"idle",2017-01-18 07:24:40 PST,2/920= 94,0,ERROR,22021,"invalid byte sequence for encoding ""UTF8"": 0x00",,,,,,&= quot;

SELECT t.oid,t.t= gname AS name, t.xmin, t.*, relname, CASE WHEN relkind =3D 'r' THEN= TRUE ELSE FALSE END AS parentistable,

=C2=A0=C2=A0=C2= =A0 nspname, des.description, l.lanname, p.prosrc, p.proname AS tfunction,<= u>

=C2=A0=C2=A0=C2= =A0 COALESCE(substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUT= E PROCEDURE'),

=C2=A0=C2=A0=C2= =A0 substring(pg_get_triggerdef(t.oid), 'WHEN (.*)=C2=A0 \\$trigge= r')) AS whenclause,

=C2=A0=C2=A0=C2= =A0 -- We need to convert tgargs column bytea datatype to array datatype=

=C2=A0=C2=A0=C2= =A0 (string_to_array(encode(tgargs, 'escape'), '\000')= ::text[])[1:tgnargs] AS tgargs,

=C2=A0=C2=A0=C2= =A0 (CASE WHEN t.oid <=3D 13321::oid THEN true ElSE false END) AS is_sys= _trigger,

=C2=A0=C2=A0=C2= =A0 (CASE WHEN tgconstraint !=3D 0::OID THEN true ElSE false END) AS is_con= starint,

=C2=A0=C2=A0=C2= =A0 (CASE WHEN tgenabled =3D 'O' THEN true ElSE false END) AS is_en= able_trigger

FROM pg_trigger = t

=C2=A0=C2=A0=C2= =A0 JOIN pg_class cl ON cl.oid=3Dtgrelid

=C2=A0=C2=A0=C2= =A0 JOIN pg_namespace na ON na.oid=3Drelnamespace

=C2=A0=C2=A0=C2= =A0 LEFT OUTER JOIN pg_description des ON (des.objoid=3Dt.oid AND des.class= oid=3D'pg_trigger'::regclass)

=C2=A0=C2=A0=C2= =A0 LEFT OUTER JOIN pg_proc p ON p.oid=3Dt.tgfoid

=C2=A0=C2=A0=C2= =A0 LEFT OUTER JOIN pg_language l ON l.oid=3Dp.prolang=

WHERE NOT tgisin= ternal

=C2=A0=C2=A0=C2= =A0 AND tgrelid =3D 17452::OID

=C2=A0=C2=A0=C2= =A0 AND t.oid =3D 18252::OID

ORDER BY tgname;",,,"pgAdmin 4 - DB:= QA961"


--001a113cd2208b02af05466bcaf6--