Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPnQx-00EDMV-Rt for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 17:41:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rPnQw-005oYI-HD for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 17:41:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPnQw-005oY9-67 for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 17:41:06 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPnQr-0029bl-IT for pgsql-general@postgresql.org; Tue, 16 Jan 2024 17:41:05 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 803525C022E; Tue, 16 Jan 2024 12:40:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 16 Jan 2024 12:40:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1705426859; x=1705513259; bh=+vtfZgqTnV5MqGs/AIDZaxGVPE1dC71f/fbM6M+vL1c=; b= dGH3X5Cf7AIdzr5AF3VhcfZc1SEzc0UbLi91STZ7D+i2VisUs7perVd4w7Sq12IP VhOPy9KcIqRGdPE3NBlMad5CnjScAi3NkkegEQ1PBNQ3YBHhraKK7YKFsIN8QdVl Hrm+RtIy+Kd3jwPpHNR4HzWcceaAn06kRfYHRJzuP16DV/9T5Ia7F3UJCZSsI6Kt YfJjuVvE0zUvpLNt13PDZqeIWFC71pzG7D/ERa/o5w7SCEDdASchJxl+oahJkMKJ 2/fyLdNir1FKbO5gLpI+imOqwKHMjyTdIE36rPN0LtH7wGRMolQiuPg4bWm1Ykk6 Uc2iNvUqhMWiXXoJdpRJrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1705426859; x= 1705513259; bh=+vtfZgqTnV5MqGs/AIDZaxGVPE1dC71f/fbM6M+vL1c=; b=y Sna3amalPxakA8k/NkWC9VgBwMknV0UvX87wZuiUuxLWOzP/YKbEEBgHWe+Qz9Ks QgbPVBkSEcLiobvhU7QqauL44q1yoW5aohKIQwIR7S4sFTm20mjzUWAMGemzFPQd TOK4YEa8vonwht5aJJZg0Usdmh2XwqjNKyG0YV84d+waJ6Lx4/POW747s8gdzuyv legmqg3pf2kjhiq+iHhKJJsnubgvC949GKVms59vOxh2De9b0j5T/akroxu4/ghL /bcayKsmqTK6PXsdZjIZg8XP8lwA5l65R4rs+89bHBbbc+vOwOcoe8BPT8Ga5hfR I8gtW9whCdXGd35y9GcYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejfedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesth ejredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeekfeehud dvjeeigfeifeejtdduudffledvfeelheeftdeiffeugfdvkeelgedtvdenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Jan 2024 12:40:58 -0500 (EST) Message-ID: Date: Tue, 16 Jan 2024 09:40:58 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Mimic ALIAS in Postgresql? Content-Language: en-US To: Ron Johnson , pgsql-general References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/16/24 09:20, Ron Johnson wrote: > Some RDBMSs have CREATE ALIAS, which allows you to refer to a table by a > different name (while also referring to it by the original name). > > > Maybe updatable views? > CREATE VIEW mtqry.sometable AS SELECT * FROM mtuser.sometable; > Assuming sometable is the same name in both schemas then the above will not work as: https://www.postgresql.org/docs/current/sql-createview.html "The name of the view must be distinct from the name of any other relation (table, sequence, index, view, materialized view, or foreign table) in the same schema." You would get a conflict with the existing table MTQRY.sometable. Though I noticed you have both MTQRY and MYQRY referring to the same thing, I think. -- Adrian Klaver adrian.klaver@aklaver.com