Skip site navigation (1) Skip section navigation (2)

Re: Storing an array to Postgresql table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Mark J(dot) Bailey" <mjb(at)jobsoft(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Storing an array to Postgresql table
Date: 2005-06-19 05:27:26
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
On Fri, Jun 17, 2005 at 09:04:32AM -0500, Mark J. Bailey wrote:
> so, what i am looking for essentially is an equiv to "COPY FROM" except 
> the "source" is @fields and not a file.

You could use COPY FROM STDIN and pg_putline -- you wouldn't even
need to split the record:

$dbh->do("COPY foo (a, b, c, d, e) FROM STDIN WITH DELIMITER '|'");

See "COPY support" in the DBD::Pg documentation for more info:

Michael Fuhr

In response to

pgsql-novice by date

Next:From: Andreas KretschmerDate: 2005-06-19 07:23:54
Subject: Re: [despammed] allowing ',' (comma) in float8
Previous:From: rabtDate: 2005-06-18 17:45:42
Subject: BIG files

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group