From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
To: pgsql-general@lists.postgresql.org
Subject: Re: pPL/pgSQL restriction on characters for copying types?
Date: Mon, 26 Feb 2024 09:42:17 -0800
Message-ID: <5e173ae9-9494-446a-850f-8d21663cfadf@aklaver.com> (raw)
In-Reply-To: <f2ea15ec-8a01-4032-b82e-3784ee2d24ee@gelassene-pferde.biz>
References: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz>
<1812333.1708965337@sss.pgh.pa.us>
<e928b61b-7bc6-4f9b-bfad-c3bf2d1a7958@gelassene-pferde.biz>
<f2ea15ec-8a01-4032-b82e-3784ee2d24ee@gelassene-pferde.biz>
On 2/26/24 09:30, Thiemo Kellner wrote:
> Shame on me. My bad. It was the order of installation that did not work.
> Sorry for that. I was mislead by the error message. If an object is
> missing I would not expect an invalid type name message.
For all the code knows it could be just a misspelling.
>
> Thanks
>
> Am 26.02.2024 um 17:53 schrieb Thiemo Kellner:
>> Thanks for the hint and care. The install script has a set statement
>> already and I now added the search_path clause to no avail. Please
>> find the entire code attached and a screenshot from the error.
>>
>> Am 26.02.2024 um 17:35 schrieb Tom Lane:
>>> Thiemo Kellner <thiemo@gelassene-pferde.biz> 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
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, thiemo@gelassene-pferde.biz
Subject: Re: pPL/pgSQL restriction on characters for copying types?
In-Reply-To: <5e173ae9-9494-446a-850f-8d21663cfadf@aklaver.com>
References: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz> <1812333.1708965337@sss.pgh.pa.us> <e928b61b-7bc6-4f9b-bfad-c3bf2d1a7958@gelassene-pferde.biz> <f2ea15ec-8a01-4032-b82e-3784ee2d24ee@gelassene-pferde.biz> <5e173ae9-9494-446a-850f-8d21663cfadf@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox