Re: proposal - function string_to_table

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - function string_to_table
Date: 2020-04-18 03:45:22
Message-ID: CAFj8pRDSzDYmaS06dfMXBfbr8x+3xjDJxA5kbL3h8+eOGoRUcA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 17. 4. 2020 v 23:29 odesílatel Justin Pryzby <pryzby(at)telsasoft(dot)com>
napsal:

> On Fri, Apr 17, 2020 at 07:47:15PM +0200, Pavel Stehule wrote:
> > I propose new function string_to_table. This function is significantly
>
> +1
>
> > +/*
> > + * Add text to result set (table or array). Build a table when set is a
> expected or build
> > + * a array
>
> as expected (??)
> *an* array
>

I tried to fix this comment

>
> > +select string_to_table('abc', '', 'abc');
> > + string_to_table
> > +-----------------
> > +
> > +(1 row)
>
> Maybe you should \pset null '(null)' for this
>

changing NULL output can break lot of existing tests, but I add second
column with info about null

+select string_to_table('1,2,3,4,*,6', ',', '*'),
string_to_table('1,2,3,4,*,6', ',', '*') IS NULL;
+ string_to_table | ?column?
+-----------------+----------
+ 1 | f
+ 2 | f
+ 3 | f
+ 4 | f
+ | t
+ 6 | f
+(6 rows)

Regards

Pavel

> --
> Justin
>

Attachment Content-Type Size
string_to_table-20200418.patch text/x-patch 12.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-04-18 04:07:15 Re: PG compilation error with Visual Studio 2015/2017/2019
Previous Message Masahiko Sawada 2020-04-18 03:38:54 Re: Race condition in SyncRepGetSyncStandbysPriority