Re: proposal - function string_to_table - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal - function string_to_table
Date
Msg-id CAFj8pRDSzDYmaS06dfMXBfbr8x+3xjDJxA5kbL3h8+eOGoRUcA@mail.gmail.com
Whole thread Raw
In response to Re: proposal - function string_to_table  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers


pá 17. 4. 2020 v 23:29 odesílatel Justin Pryzby <pryzby@telsasoft.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

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Race condition in SyncRepGetSyncStandbysPriority
Next
From: Amit Kapila
Date:
Subject: Re: PG compilation error with Visual Studio 2015/2017/2019