Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1i5E-0005Tg-VZ for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Nov 2016 23:03:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c1i5E-000691-72 for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Nov 2016 23:03:08 +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 1c1h2p-00010X-RB for pgsql-bugs@postgresql.org; Tue, 01 Nov 2016 21:56:35 +0000 Received: from ngfw3.officehouse.cz ([62.209.199.98]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1h2m-00066e-6p for pgsql-bugs@postgresql.org; Tue, 01 Nov 2016 21:56:34 +0000 Received: (qmail 6036 invoked by uid 109); 1 Nov 2016 21:56:29 -0000 Received: from pc1411.amazon.xx (HELO alfik) (10.168.7.91) by smtp.isit.xx (qpsmtpd/0.84) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 01 Nov 2016 22:56:29 +0100 From: Pavel =?utf-8?Q?Han=C3=A1k?= To: pgsql-bugs@postgresql.org Cc: pavel.stehule@gmail.com Subject: Problems with "pg.dropped" column after upgrade 9.5 to 9.6 Date: Tue, 01 Nov 2016 22:56:28 +0100 Message-ID: <83shraampf.fsf@is-it.eu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -1.9 (-) 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 Hi, I've got very the similar problem as described in the message with the subject "got some errors after upgrade poestgresql from 9.5 to 9.6". I'll try to describe this very strange behaviour. I have a table A which has some "pg.dropped" attribute in pg_attribute table. It looks like: select attname, attnum from pg_attribute where attrelid = A::regclass and attisdropped; attname | attnum -------------------------------+-------- ........pg.dropped.57........ | 57 (1 row) Now, I create SQL function doing only update on this table when the boolean parameter of the function is True: CREATE OR REPLACE FUNCTION _test_sql_update(in do_update boolean) RETURNS VOID LANGUAGE sql VOLATILE AS $$ update A set col = NULL where do_update; $$; Now running: select _test_sql_update(False); returns this error: ERROR: table row type and query-specified row type do not match DETAIL: Query provides a value for a dropped column at ordinal position 57. CONTEXT: SQL function "_test_sql_update" statement 1 If I don't use the parameter in "where" and instead I use the constant False directly, everything works: CREATE OR REPLACE FUNCTION _test_sql_update(in do_update boolean) RETURNS VOID LANGUAGE sql VOLATILE AS $$ update A set col = NULL where False; $$; select _test_sql_update(False); SQL=# _test_sql ----------- (1 row) If I define the function as plpgsql, everything is also working: CREATE OR REPLACE FUNCTION _test_plpgsql_update(in do_update boolean) RETURNS VOID LANGUAGE plpgsql VOLATILE AS $$ BEGIN update A set col = NULL where do_update; END; $$; My conclusion is: The problem occurs only under these circumstances: - Postgresql 9.6 (no problem in 9.5) - SQL function doing update - There is a boolean parameter of the fucntion used in the update command and the table which is updated has some attisdropped attributes Can anybody explain what is the problem? Thanks Pavel -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs