From: | Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | pPL/pgSQL restriction on characters for copying types? |
Date: | 2024-02-26 15:51:54 |
Message-ID: | 88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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
Attachment | Content-Type | Size |
---|---|---|
NODE_GOOD⠒TR_B_IU_R.pg_sql | text/plain | 946 bytes |
NODE⠒V.pg_sql | text/plain | 5.4 KB |
NODE_GOOD⠒V.pg_sql | text/plain | 4.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Markus Oley | 2024-02-26 15:53:35 | Postgres > 12 with Windows Server 2012 |
Previous Message | Laurenz Albe | 2024-02-26 15:29:59 | Re: could not open file "global/pg_filenode.map": Operation not permitted |