Re: [HACKERS] [PATCH] Generic type subscripting - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: [HACKERS] [PATCH] Generic type subscripting
Date
Msg-id CA+q6zcVoVJAEZB55MJ60pYvrr52efgySfyAo52XO8Acy6mHpJg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Generic type subscripting  (Dmitry Dolgov <9erthalion6@gmail.com>)
Responses Re: [HACKERS] [PATCH] Generic type subscripting  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
List pgsql-hackers
> On 11 September 2017 at 23:55, Dmitry Dolgov <9erthalion6@gmail.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

pgsql-hackers by date:

Previous
From: Nico Williams
Date:
Subject: Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINTTRIGGERS
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] pgjdbc logical replication client throwing exception