bulk loader

Started by Hrishikesh Deshmukhalmost 21 years ago5 messagesgeneral
Jump to latest
#1Hrishikesh Deshmukh
hdeshmuk@gmail.com

Hi All,

Is there a "bulk loader" in postgresql with which one can read in say
a tab delimited format text file. Before one does all one has to do is
create the table with text file column names as attributes, once it is
on DBMS world it will be a simple table (non-relational)!!!!

Thanks,
Hrishi

#2Doug McNaught
doug@mcnaught.org
In reply to: Hrishikesh Deshmukh (#1)
Re: bulk loader

Hrishikesh Deshmukh <hdeshmuk@gmail.com> writes:

Hi All,

Is there a "bulk loader" in postgresql with which one can read in say
a tab delimited format text file. Before one does all one has to do is
create the table with text file column names as attributes, once it is
on DBMS world it will be a simple table (non-relational)!!!!

Read up on the COPY command.

-Doug

#3Guy Rouillier
guyr@masergy.com
In reply to: Doug McNaught (#2)
Re: bulk loader

Hrishikesh Deshmukh wrote:

Hi All,

Is there a "bulk loader" in postgresql with which one can read in say
a tab delimited format text file. Before one does all one has to do
is create the table with text file column names as attributes, once
it is on DBMS world it will be a simple table (non-relational)!!!!

See the COPY command. Tab is the default delimiter in text mode.

--
Guy Rouillier

#4Brent Wood
b.wood@niwa.co.nz
In reply to: Hrishikesh Deshmukh (#1)
Re: bulk loader

On Thu, 19 May 2005, Hrishikesh Deshmukh wrote:

Hi All,

Is there a "bulk loader" in postgresql with which one can read in say
a tab delimited format text file. Before one does all one has to do is
create the table with text file column names as attributes, once it is
on DBMS world it will be a simple table (non-relational)!!!!

See copy

from memory, pretty much as in:

cat <file> | \
psql -d $DB -c "copy <table> from STDIN [with delimiter ','];"

You'll see that db users can't copy a file into a table but can copy
STDIN, so this approach works well.

Brent Wood

#5Chris Browne
cbbrowne@acm.org
In reply to: Hrishikesh Deshmukh (#1)
Re: bulk loader

After takin a swig o' Arrakan spice grog, hdeshmuk@gmail.com (Hrishikesh Deshmukh) belched out:

Is there a "bulk loader" in postgresql with which one can read in say
a tab delimited format text file. Before one does all one has to do is
create the table with text file column names as attributes, once it is
on DBMS world it will be a simple table (non-relational)!!!!

There is the built in "COPY" command which can do this sort of thing.

Jan Wieck wrote a "load" tool that does a more sophisticated job of
slicing up the data. Look at pgFoundry.org for "pgloader". There are
thoughts of trying to make this work much like Oracle's SQL*Loader
product.
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','gmail.com').
http://linuxdatabases.info/info/postgresql.html
FLORIDA: We've been Gored by the bull of politics and we're Bushed.