Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK0RS-0007lT-QO for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Feb 2022 16:12:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nK0RR-0002ph-DN for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Feb 2022 16:12:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK0RR-0002pX-4t for pgsql-bugs@lists.postgresql.org; Tue, 15 Feb 2022 16:12:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK0RO-0006Qz-Th for pgsql-bugs@lists.postgresql.org; Tue, 15 Feb 2022 16:12:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 21FGCW7F3049979; Tue, 15 Feb 2022 11:12:32 -0500 From: Tom Lane To: pageorge@unice.fr cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17404: CREATE OR REPLACE VIEW does not properly change the COLLATION of an existing field. In-reply-to: <17404-8a4a270ef30a6709@postgresql.org> References: <17404-8a4a270ef30a6709@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 15 Feb 2022 08:51:11 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3049977.1644941552.1@sss.pgh.pa.us> Date: Tue, 15 Feb 2022 11:12:32 -0500 Message-ID: <3049978.1644941552@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > create TABLE my_table (my_text TEXT); > create VIEW my_view AS SELECT my_text COLLATE "C" FROM my_table; > create OR REPLACE view my_view AS SELECT my_text COLLATE "en_US.utf8" FROM > my_table; > The COLLATION of "my_view"."my_text" should have been changed to > "en_US.utf8". > - OR - > I should have got an error message telling me that it is not possible. Yeah, that's a bug, it should have thrown an error. (Changing the collation is impractical for the same reasons that changing the output datatype is impractical.) regards, tom lane