Re: quoted csv to array pattern - Mailing list pgsql-sql

From Michael Moore
Subject Re: quoted csv to array pattern
Date
Msg-id CACpWLjOOevxUWT9jOcQXpbPW5eyCo+tjBw3juxiRkeKgaZDLjQ@mail.gmail.com
Whole thread Raw
In response to Re: quoted csv to array pattern  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-sql
Well, that explains why I couldn't find a solution. Thanks David

On Wed, May 25, 2016 at 4:34 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, May 25, 2016 at 7:25 PM, Michael Moore <michaeljmoore@gmail.com> wrote:
I am trying to use
SELECT regexp_split_to_table('''quick brown'', ''fox'' ''over, dog''',  ','); 

I need the output to be:
quick brown
fox
over, dog


You cannot reliably/easily parse/split CSV with embedded delimiters using regex...you can cheat a bit if your data allows by making the delimiter <', '> instead of just <,>

David J.


 

pgsql-sql by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: quoted csv to array pattern
Next
From: Michael Moore
Date:
Subject: Re: My "variable number of bind variables for dynamic SQL" solution. Comments?