Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buCnI-00042N-R9 for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Oct 2016 06:13:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1buCnI-00023l-Al for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Oct 2016 06:13:36 +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 1buCSb-0006z7-EV for pgsql-bugs@postgresql.org; Wed, 12 Oct 2016 05:52:13 +0000 Received: from mail.p1.com ([123.59.92.135]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buCST-0002S9-9c for pgsql-bugs@postgresql.org; Wed, 12 Oct 2016 05:52:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.p1.com (Postfix) with ESMTP id C19A41A41BE; Wed, 12 Oct 2016 13:51:51 +0800 (CST) Received: from mail.p1.com ([127.0.0.1]) by localhost (mail.p1.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dST5pZMY5Z_x; Wed, 12 Oct 2016 13:51:48 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by mail.p1.com (Postfix) with ESMTP id 687561A427C; Wed, 12 Oct 2016 13:51:48 +0800 (CST) X-Virus-Scanned: amavisd-new at mail.p1.com Received: from mail.p1.com ([127.0.0.1]) by localhost (mail.p1.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qRoOYwxEa7LH; Wed, 12 Oct 2016 13:51:48 +0800 (CST) Received: from mail.p1.com (mail.p1.com [123.59.92.135]) by mail.p1.com (Postfix) with ESMTP id ECBE01A41BE; Wed, 12 Oct 2016 13:51:47 +0800 (CST) Date: Wed, 12 Oct 2016 13:51:47 +0800 (CST) From: =?utf-8?B?5byg5ZiJ5b+X?= To: Pavel Stehule Cc: pgsql-bugs@postgresql.org, backend , dba Message-ID: <713389805.16313402.1476251507846.JavaMail.zimbra@p1.com> In-Reply-To: References: <1560190516.16233092.1476249746147.JavaMail.zimbra@p1.com> <176151950.16244873.1476250054458.JavaMail.zimbra@p1.com> Subject: Re: got some errors after upgrade poestgresql from 9.5 to 9.6 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16313401_658074265.1476251507844" X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - SAF9.1 (Mac)/8.0.9_GA_6191) Thread-Topic: got some errors after upgrade poestgresql from 9.5 to 9.6 Thread-Index: DU3kPs5fuga7yYEM7Uk3REcvmdPITg== X-Zimbra-DL: backend@p1.com, dba@p1.com X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ------=_Part_16313401_658074265.1476251507844 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable thanks for your reply , i try to vacuum the table , can't work , i also rec= reate the table , worked , but can't do this in production , because we hav= e lots of big table had change the columns ,=20 and thanks for your reminder , before delete the data from system catalog t= able , i do a backup , and restore it after test. .accturlly , vacuum full = is like recreate a new table , but i will test=20 can someone can explain this errors.=20 thanks a lot .=20 ----- =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 ----- =E5=8F=91=E4=BB=B6=E4=BA=BA: "Pavel Stehule" =20 =E6=94=B6=E4=BB=B6=E4=BA=BA: "=E5=BC=A0=E5=98=89=E5=BF=97" =20 =E6=8A=84=E9=80=81: pgsql-bugs@postgresql.org, "backend" , = "dba" =20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: =E6=98=9F=E6=9C=9F=E4=B8=89, 2016=E5= =B9=B4 10 =E6=9C=88 12=E6=97=A5 =E4=B8=8B=E5=8D=88 1:40:15=20 =E4=B8=BB=E9=A2=98: Re: [BUGS] got some errors after upgrade poestgresql fr= om 9.5 to 9.6=20 2016-10-12 7:27 GMT+02:00 =E5=BC=A0=E5=98=89=E5=BF=97 < zhangjiazhi@p1.com = > :=20 Hi=20 I am got a problem after upgrade poestgresql from 9.5 to 9.6 .it's occurred= when calling an exits function .=20 It is little bit strange - I don't remember any related change in this area= .=20
putong-contacts=3D# select insert_user_mobile_contact_hashes(4009, '', ARRA= Y['7bd94067bb0597bf995c4eb46364a4ce'], ARRAY['c55288a186d0e6f0e3fb3b66deb65= 366'], ARRAY[''], false);=20 ERROR: table row type and query-specified row type do not match=20 DETAIL: Query provides a value for a dropped column at ordinal position 6.= =20 CONTEXT: SQL statement "UPDATE c=20 SET=20 phone_number =3D phone_number_arr_[i],=20 name =3D name_=20 WHERE=20 user_id =3D user_id_=20 AND=20 md5_hash11 =3D md5_hash11_arr_[i]=20 AND=20 coalesce(phone_number,'') =3D ''=20 AND=20 char_length(phone_number_arr_[i]) > 0"=20 PL/pgSQL function insert_user_mobile_contact_hashes(integer,character varyi= ng,character varying[],character varying[],character varying[],boolean) lin= e 36 at SQL statement=20 and here is the column in this table be dropped=20 putong-contacts=3D# select * from pg_attribute where attrelid =3D 'user_mob= ile_contact_hashes'::regclass and attisdropped;=20 attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims = | attcacheoff | atttypmod | attbyval | attstorage | attalign | attnotnull |= atthasdef | attisdropped | attislocal | attinhcount | attcollation | attac= l | attoptions | attfdwoptions=20 ----------+-------------------------------+----------+---------------+-----= ---+--------+----------+-------------+-----------+----------+------------+-= ---------+------------+-----------+--------------+------------+------------= -+--------------+--------+------------+---------------=20 6097850 | ........pg.dropped.6........ | 0 | 0 | 8 | 6 | 0 | -1 | -1 | f | = p | d | f | f | t | t | 0 | 0 | | |=20 6097850 | ........pg.dropped.10........ | 0 | 0 | 1 | 10 | 0 | -1 | -1 | f = | p | c | f | f | t | t | 0 | 0 | | |=20 when i create this table user_mobile_contact_hashes , the function works we= ll. i try to delete those 2 dropped column info from system catalog table ,= but it can't work and got other problems.=20
It is most bad idea! Newer delete anything from system tables. Now, the sys= tem catalogue is broken.=20 The correct fix for first issue is a VACUUM FULL. Second issue - you can tr= y drop table and recreate it,=20 Regards=20 Pavel=20
putong-contacts=3D# select insert_user_mobile_contact_hashes(4009, '', ARRA= Y['7bd94067bb0597bf995c4eb46364a4ce'], ARRAY['c55288a186d0e6f0e3fb3b66deb65= 366'], ARRAY[''], false);=20 ERROR: catalog is missing 2 attribute(s) for relid 6097850=20 Can you explain this issue and give me some advise how to handle this . tha= nks a lot .=20 --=20 Sent via pgsql-bugs mailing list ( pgsql-bugs@postgresql.org )=20 To make changes to your subscription:=20 http://www.postgresql.org/mailpref/pgsql-bugs=20
------=_Part_16313401_658074265.1476251507844 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
thanks for your reply  , i = try to vacuum the table , can't work , i also recreate the table , worked ,= but can't do this in production , because we have lots of big table had ch= ange the columns , 
and thanks for your reminder , before de= lete the data from system catalog table , i do a backup , and restore it af= ter test. .accturlly , vacuum full is like recreate a new table , but i wil= l test
can someone can explain this errors. 

<= /div>
thanks a  lot .


=E5=8F=91=E4=BB= =B6=E4=BA=BA: "Pavel Stehule" <pavel.stehule@gmail.com>
=E6= =94=B6=E4=BB=B6=E4=BA=BA: "=E5=BC=A0=E5=98=89=E5=BF=97" <zhangjiazhi= @p1.com>
=E6=8A=84=E9=80=81: pgsql-bugs@postgresql.org, "backe= nd" <backend@p1.com>, "dba" <dba@p1.com>
=E5=8F=91=E9=80= =81=E6=97=B6=E9=97=B4: =E6=98=9F=E6=9C=9F=E4=B8=89, 2016=E5=B9=B4 10 = =E6=9C=88 12=E6=97=A5 =E4=B8=8B=E5=8D=88 1:40:15
=E4=B8=BB=E9=A2=98: = Re: [BUGS] got some errors after upgrade poestgresql from 9.5 to 9.6



2016-10-12 7:27 GMT+02:00 =E5=BC=A0=E5=98=89=E5=BF=97 <= span dir=3D"ltr"><zhangjiazhi@p1.com>:
Hi
  I am got a problem after upgrade poestgresql from 9.5 to 9.6 .it's o= ccurred when calling an exits function .



It is little bit strange - I don't rem= ember any related change in this area.
 

putong-contacts=3D# select insert_user_mobile_contact_hashes(4009, '', ARRA= Y['7bd94067bb0597bf995c4eb46364a4ce'], ARRAY['c55288a186d0e6f0e3fb3b66deb65= 366'], ARRAY[''], false);
ERROR:  table row type and query-specified row type do not match
DETAIL:  Query provides a value for a dropped column at ordinal positi= on 6.
CONTEXT:  SQL statement "UPDATE c
                     = ;   SET
                     = ;         phone_number =3D phone_number_arr_[i],
                     = ;         name =3D name_
                     = ;   WHERE
                     = ;         user_id =3D user_id_
                     = ;   AND
                     = ;         md5_hash11 =3D md5_hash11_arr_[i]
                     = ;   AND
                     = ;         coalesce(phone_number,'') =3D ''
                     = ;   AND
                     = ;         char_length(phone_number_arr_[i]) > 0"
PL/pgSQL function insert_user_mobile_contact_hashes(integer,character varyi= ng,character varying[],character varying[],character varying[],boolean) lin= e 36 at SQL statement


and here is the column in this table be dropped

putong-contacts=3D# select *  from pg_attribute where attrelid =3D 'us= er_mobile_contact_hashes'::regclass and attisdropped;
 attrelid |            attname  &nb= sp;         | atttypid | attstattarget | attlen | attnu= m | attndims | attcacheoff | atttypmod | attbyval | attstorage | attalign |= attnotnull | atthasdef | attisdropped | attislocal | attinhcount | attcoll= ation | attacl | attoptions | attfdwoptions
----------+-------------------------------+----------+---------------+-----= ---+--------+----------+-------------+-----------+----------+------------+-= ---------+------------+-----------+--------------+------------+------------= -+--------------+--------+------------+---------------
  6097850 | ........pg.dropped.6........  |      &= nbsp; 0 |             0 |    &= nbsp; 8 |      6 |        0 |  &nbs= p;       -1 |        -1 | f   =     | p          | d     = ;   | f          | f      &nbs= p;  | t            | t    &nbs= p;     |           0 |   =         0 |        |    =         |
  6097850 | ........pg.dropped.10........ |       = 0 |             0 |     = 1 |     10 |        0 |    &n= bsp;     -1 |        -1 | f    &nbs= p;   | p          | c      &nb= sp; | f          | f        &n= bsp;| t            | t      &n= bsp;   |           0 |    &nbs= p;       0 |        |     = ;       |




when i create this table user_mobile_contact_hashes , the function works we= ll. i try to delete those 2 dropped column info from system catalog table ,= but it can't work  and got other problems.

<= /div>
It is most bad idea! Newer delete anything from system tables. No= w, the system catalogue is broken.

The correct= fix for first issue is a VACUUM FULL. Second issue - you can try drop tabl= e and recreate it,

Regards

<= /div>
Pavel
 


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


------=_Part_16313401_658074265.1476251507844--