Re: pPL/pgSQL restriction on characters for copying types? - Mailing list pgsql-general

From Thiemo Kellner
Subject Re: pPL/pgSQL restriction on characters for copying types?
Date
Msg-id e9ff3134-4d87-435b-ad30-a0b273b70137@gelassene-pferde.biz
Whole thread Raw
In response to pPL/pgSQL restriction on characters for copying types?  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
List pgsql-general
Oh, I totally forgot to mention that I ran the scripts with DbVisualizer 
against a 16.1 (Debian 16.1-1.pgdg110+1) server using PostgreSQL JDBC 
Driver 42.6.0 .

Am 26.02.2024 um 16:51 schrieb Thiemo Kellner:
> Hi
> 
> My names can contain a special character (⠒), e.g. to separate the 
> donator object from the name or the name from the type. Typically, I use 
> this with foreign keys, e.g. table PARENT has the surrogate key ID, the 
> table CHILD would then have the column PARENT⠒ID. That way, I can use 
> the underscore to segment column names like yet_another_column_name. I 
> do not like camel-case in that case because names do not have to be case 
> sensitive.
> 
> 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.
> 
> V⠒NODE_TYPE⠒NAME text;
> 
> Please find attached script files of objects directly involved in the 
> trigger function.
> 
> Is there something, I am doing wrongly?
> 
> Kind Regards
> 
> Thiemo



pgsql-general by date:

Previous
From: Markus Oley
Date:
Subject: Postgres > 12 with Windows Server 2012
Next
From: Adrian Klaver
Date:
Subject: Re: Fastest way to clone schema ~1000x