Inputting columns of data

From: "C G" <csgcsg39(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Inputting columns of data
Date: 2004-02-16 15:46:10
Message-ID: LAW12-F126U1Gj03oHM00017e1d@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear All,

I have a text file with data like:
1 2 3
4 5 6
7 8 9
i.e. so I have three columns of numbers.

I wish to put this data into a table. However, I do not want it to take up
three rows, rather only a single row and a single column. I was think
something like this

CREATE TABLE t1(data numeric[]);
INSERT INTO TABLE t1 VALUES ('{1 4 7, 2 5 8, 3 6 9}')

but this does not work.

What's the best way of approaching this problem? All the files I'll put into
the table will not have the same number of columns, or be the same length. I
would only like to access a single column of data, but never a single
number.

Many thanks

Colin

_________________________________________________________________
Sign-up for a FREE BT Broadband connection today!
http://www.msn.co.uk/specials/btbroadband

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karam Chand 2004-02-16 15:48:48 PGSQL C API()
Previous Message Tom Lane 2004-02-16 15:45:47 Re: Dazed and Confused