Re: PL/pgSQL: Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[]

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Quan Zongliang <quanzongliang@yeah.net>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-10-16T11:53:11Z
Lists: pgsql-hackers
> On 16 Oct 2023, at 12:15, Quan Zongliang <quanzongliang@yeah.net> wrote:

> Implement TODO item:
> PL/pgSQL
> Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[]

Cool!  While I haven't looked at the patch yet, I've wanted this myself many
times in the past when working with large plpgsql codebases.

> As a first step, deal only with [], such as
> xxx.yyy%TYPE[]
> xxx%TYPE[]
> 
> It can be extended to support multi-dimensional and complex syntax in the future.

Was this omitted due to complexity of implementation or for some other reason?

--
Daniel Gustafsson




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Clean up some edge cases in plpgsql's %TYPE parsing.

  2. In plpgsql, allow %TYPE and %ROWTYPE to be followed by array decoration.