How to split an array-column?

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: How to split an array-column?
Date: 2013-03-18 19:13:21
Message-ID: 51476751.1040902@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I've got a table to import from csv that has an array-column like:

import ( id, array_col, ... )

Those arrays look like ( 42, ";4941;4931;4932", ... )
They can have 0 or any number of elements separated by ;

So I'd need a result like this:
42, 4941
42, 4931
42, 4932

How would I get this?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Venky Kandaswamy 2013-03-18 19:24:55 Re: How to split an array-column?
Previous Message Claudio Adriano Guarracino 2013-03-17 15:47:38 link