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

2024-01-04 Thread Pavel Stehule
čt 4. 1. 2024 v 22:02 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > Now, I think so this simple patch is ready for committers > > I pushed this with some editorialization -- mostly, rewriting the > documentation and comments. I found that the existing docs for %TYPE > were not great.

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

2024-01-04 Thread Tom Lane
Pavel Stehule writes: > Now, I think so this simple patch is ready for committers I pushed this with some editorialization -- mostly, rewriting the documentation and comments. I found that the existing docs for %TYPE were not great. There are two separate use-cases, one for referencing a table

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

2023-11-23 Thread Pavel Stehule
pá 24. 11. 2023 v 2:12 odesílatel Quan Zongliang napsal: > > > On 2023/11/24 03:39, Pavel Stehule wrote: > > > > > I modified the documentation a little bit - we don't need to extra > > propose SQL array syntax, I think. > > I rewrote regress tests - we don't need to test unsupported > > function

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

2023-11-23 Thread Quan Zongliang
On 2023/11/24 03:39, Pavel Stehule wrote: I modified the documentation a little bit - we don't need to extra propose SQL array syntax, I think. I rewrote regress tests - we don't need to test unsupported functionality (related to RECORD). - all tests passed I wrote two examples of error

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

2023-11-23 Thread Pavel Stehule
čt 23. 11. 2023 v 13:28 odesílatel Quan Zongliang napsal: > > > On 2023/11/20 17:33, Pavel Stehule wrote: > > > > > > > I did some deeper check: > > > > - I don't like too much parser's modification (I am sending alternative > > own implementation) - the SQL parser allows richer syntax, and for f

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

2023-11-23 Thread Quan Zongliang
On 2023/11/20 17:33, Pavel Stehule wrote: I did some deeper check: - I don't like too much parser's modification (I am sending alternative own implementation) - the SQL parser allows richer syntax, and for full functionality is only few lines more Agree. - original patch doesn't solve

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

2023-11-20 Thread Pavel Stehule
Hi út 17. 10. 2023 v 3:20 odesílatel Quan Zongliang napsal: > > Attached new patch >More explicit error messages based on type. > > > On 2023/10/16 18:15, Quan Zongliang wrote: > > > > > > Implement TODO item: > > PL/pgSQL > > Incomplete i

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

2023-10-17 Thread Pavel Stehule
Hi > Isn't this code a little ugly? > > > > > I propose syntax xxx.yyy%ELEMENTTYPE and xxx%ELEMENTTYPE > > > > What do you think about it? > No other relational database can be found with such an implementation. > But it seems like a good idea. It can bring more convenience to write > stored proc

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

2023-10-17 Thread Quan Zongliang
@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 >     

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

2023-10-16 Thread Pavel Stehule
23, at 12:15, Quan Zongliang > <mailto:quanzongli...@yeah.net>> wrote: > > > > > Implement TODO item: > > > PL/pgSQL > > > Incomplete item Allow handling of %TYPE arrays, e.g. > tab.col%TYPE[] > > > > Cool! While I haven

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

2023-10-16 Thread Quan Zongliang
> 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

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

2023-10-16 Thread Quan Zongliang
2023/10/16 18:15, Quan Zongliang wrote: Implement TODO item: PL/pgSQL Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[] 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 f

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

2023-10-16 Thread Quan Zongliang
Attached new patch More explicit error messages based on type. On 2023/10/16 18:15, Quan Zongliang wrote: Implement TODO item: PL/pgSQL Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[] As a first step, deal only with [], such as xxx.yyy%TYPE[] xxx%TYPE[] It can be

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

2023-10-16 Thread Pavel Stehule
po 16. 10. 2023 v 13:56 odesílatel Daniel Gustafsson napsal: > > On 16 Oct 2023, at 12:15, Quan Zongliang wrote: > > > Implement TODO item: > > PL/pgSQL > > Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[] > > Cool! While I haven't loo

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

2023-10-16 Thread Daniel Gustafsson
> On 16 Oct 2023, at 12:15, Quan Zongliang 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 l

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

2023-10-16 Thread Quan Zongliang
Implement TODO item: PL/pgSQL Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[] 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. -- Quan Zongliangdiff --git a/src/pl