pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pPL/pgSQL restriction on characters for copying types?
Date: Mon, 26 Feb 2024 11:35:37 -0500
Message-ID: <1812333.1708965337@sss.pgh.pa.us> (raw)
In-Reply-To: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz>
References: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz>

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





view thread (8+ messages)  latest in thread

Message-ID: <1812333.1708965337@sss.pgh.pa.us>
Permalink:  ../1812333.1708965337@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1812333.1708965337@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, thiemo@gelassene-pferde.biz
  Subject: Re: pPL/pgSQL restriction on characters for copying types?
  In-Reply-To: <1812333.1708965337@sss.pgh.pa.us>
  References: <88b574f4-cc08-46c5-826b-020849e5a356@gelassene-pferde.biz> <1812333.1708965337@sss.pgh.pa.us>

* 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