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 1redyE-00CaCG-4Q for pgsql-general@arkaria.postgresql.org; Mon, 26 Feb 2024 16:36:50 +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 1redxE-00F6pK-BU for pgsql-general@arkaria.postgresql.org; Mon, 26 Feb 2024 16:35:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1redxD-00F6pB-T3 for pgsql-general@lists.postgresql.org; Mon, 26 Feb 2024 16:35:48 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1redx9-001FAE-VR for pgsql-general@lists.postgresql.org; Mon, 26 Feb 2024 16:35:47 +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 41QGZb9a1812334; Mon, 26 Feb 2024 11:35:37 -0500 From: Tom Lane To: Thiemo Kellner cc: pgsql-general@lists.postgresql.org Subject: Re: pPL/pgSQL restriction on characters for copying types? In-reply-to: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz> References: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz> Comments: In-reply-to Thiemo Kellner message dated "Mon, 26 Feb 2024 16:51:54 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1812332.1708965337.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 26 Feb 2024 11:35:37 -0500 Message-ID: <1812333.1708965337@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thiemo Kellner writes: > However, I want to create a (trigger) function to impose data > consistency. For that purpose, I try to copy the data type of a PL/pgSQL > variable from the base object, a view in that case. Trying so, I get the > following error on installation of the function. > V⠒NODE_TYPE⠒NAME NODE⠒V.NODE_TYPE⠒NAME%type := null; > Syntax error at "%" … invalid type name. If I use the actual type of the > column, all is fine. FWIW, I couldn't reproduce this with the fragmentary scripts you provided. I suspect the problem is not about the special characters in the names, rather about search_path not including the NODE⠒V view. Consider schema-qualifying the view name, or attaching a "SET search_path" clause to the function. regards, tom lane