Re: string_to_array, array_to_string function without separator

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chapman Flack <chap(at)anastigmatix(dot)net>, David Fetter <david(at)fetter(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: string_to_array, array_to_string function without separator
Date: 2019-03-15 16:26:22
Message-ID: CAFj8pRDHnXNBjmapC=LAmiW1kVnN0teoXhqbVUfCRkUxmKNp_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 15. 3. 2019 v 17:16 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Chapman Flack <chap(at)anastigmatix(dot)net> writes:
> > So the proposal seems roughly equivalent to making string_to_array's
> > second parameter optional default null, and array_to_string's second
> > parameter optional default ''.
>
> In that case why bother? It'll just create a cross-version compatibility
> hazard for next-to-no keystroke savings. If the cases were so common
> that they could be argued to be sane "default" behavior, I might feel
> differently --- but if you were asked in a vacuum what the default
> delimiters ought to be, I don't think you'd say "no delimiter".
>

My motivation is following - sometimes I need to convert string to array of
chars. Using NULL as separator is possible, but it is not intuitive. When
you use string_to_array function without separator, then only one possible
semantic is there - separation by chars.

I understand so there is a possible collision and possible meaning of
missing parameter like default value. But in this case this meaning,
semantic is not practical.

Regards

Pavel

> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-03-15 16:27:45 Re: GTIN14 support for contrib/isn
Previous Message emmjadea 2019-03-15 16:24:24 Inquiries