Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVGBF-0004ez-1n for pgsql-general@arkaria.postgresql.org; Thu, 14 Nov 2019 14:33:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iVGAF-0007Hx-Gr for pgsql-general@arkaria.postgresql.org; Thu, 14 Nov 2019 14:32:03 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVGAE-0007Hq-Ia for pgsql-general@lists.postgresql.org; Thu, 14 Nov 2019 14:32:03 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVGA6-0003Gd-9a for pgsql-general@lists.postgresql.org; Thu, 14 Nov 2019 14:32:02 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 60DDA59A; Thu, 14 Nov 2019 09:31:50 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 14 Nov 2019 09:31:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=Q SFzCF9xFC7a+I/PjNPBF034/ThaT9OI/AU2cZi1j84=; b=fzDoHFZE5Yx++/tkG 5p+wUizI5PV6xpakdUniRjGAeIv8PKtjcH8IoSot7ct/r0PbsZtBI5JmKJ1jh+qI 17WStMuKrpiW5Wy9XBE073zP2luRHLBKtzCSZjZ2qiIK9Xi47Si2sponAV6wnRwK qmLcLCVQdyviPISQAlx/EL/dKJetRkSIbOX5RRCmOn0paV3yDNFg8env2YiASC1l Rx/PNPUq8tkM27sEqEAGW/Va05yObtrf0hTGIxeGKy+8R02niLtN9CHvOu4hyjiW 2Yq5EIQB5D8392DNhnRAE1lXUJ6yzTGNNL8u7fYwvq7QD3FKUhBuEefc1d2PUwe4 mOBkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=QSFzCF9xFC7a+I/PjNPBF034/ThaT9OI/AU2cZi1j 84=; b=Q+5jOYM/JGRZaWV0c4h2dXvC1oCxpfNKrWKzpfFjj0s0lTc+bVgU2/2fv E8TwWUfUtLBcQwxfFckwNBFQUNC/mePWCMTDmASv+nw6ayfnD7Md6zn1ineh9410 7HSmb/RoU5/8flvluvMqWgDPx2I7YwKPaKEkbibE2+JXEqr7Xs03G2kL5rotRpfn h9cprjQtdKd9w3KEqN1XKSU1X54+h2edbAkQbMC199wp95W9PlBKbpU7OheRIrru +rvp8ErcEEskmdeeKvApzrA8l96QlO+GVDnnAqlUSWaG9F1oFmM7qQnG6M9ZU0mw gMLuyMQV4D855jSKVDp83ATRo3qQw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeffedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepjedurddvuddvrddugeegrdejheenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.144.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 415BB80065; Thu, 14 Nov 2019 09:31:49 -0500 (EST) Subject: Re: Problems modifyiong view To: stan , pgsql-general@lists.postgresql.org References: <20191114135356.GA14970@panix.com> From: Adrian Klaver Message-ID: <6bf84c77-0587-889a-2022-afd9ca9a2b4d@aklaver.com> Date: Thu, 14 Nov 2019 06:31:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191114135356.GA14970@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/14/19 5:53 AM, stan wrote: > I am trying to add columns to a view using CREATE OR REPLACE VIEW, and I am > getting the following error: > > ERROR: cannot change name of view column "descrip" to "contact_person_1" > > I suppose I can drop the view, and recreate it, but that seems to indicate > that the create or replace functionality is not functioning the way I would > expect. > > Am I missing something here? > https://www.postgresql.org/docs/11/sql-createview.html "CREATE OR REPLACE VIEW is similar, but if a view of the same name already exists, it is replaced. The new query must generate the same columns that were generated by the existing view query (that is, the same column names in the same order and with the same data types), but it may add additional columns to the end of the list. The calculations giving rise to the output columns may be completely different." -- Adrian Klaver adrian.klaver@aklaver.com