Re: [PATCH] Generic type subscripting

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Generic type subscripting
Date: 2017-09-15 20:02:00
Message-ID: CA+q6zcVoVJAEZB55MJ60pYvrr52efgySfyAo52XO8Acy6mHpJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 11 September 2017 at 23:55, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
wrote:
>
> Sure, an SQL command for that purpose is much better than a runtime check.
> I'm going to add such command to the patch, thank you for the information!

So, I've implemented a patch for that in form of a `DEPENDS ON` syntax for
creating a function.
Basically it looks like this (and initially I was looking for something
like that in the documentation,
you can find a complete example in the test `create_function_3.sql`):

```
CREATE FUNCTION custom_subscripting_extract(internal)
RETURNS internal;

CREATE FUNCTION custom_subscripting_assign(internal)
RETURNS internal;

CREATE FUNCTION custom_subscript_parse(internal)
RETURNS internal
DEPENDS ON custom_subscripting_extract, custom_subscripting_assign;
```

I hope it sounds reasonable and can help to address a problem with
dependencies between functions.

Attachment Content-Type Size
0001-Base-implementation-of-subscripting-mechanism.patch application/octet-stream 159.5 KB
0002-Subscripting-for-arrays.patch application/octet-stream 12.5 KB
0003-Subscripting-for-jsonb.patch application/octet-stream 32.8 KB
0004-Subscripting-documentation.patch application/octet-stream 17.9 KB
0005-Function-depends-on.patch application/octet-stream 12.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-09-15 20:05:16 Re: [HACKERS] pgjdbc logical replication client throwing exception
Previous Message Nico Williams 2017-09-15 20:00:35 Re: COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS