dbTalk Databases Forums  

Loading fixed with files

comp.databases.postgresql comp.databases.postgresql


Discuss Loading fixed with files in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David McNelis
 
Posts: n/a

Default Loading fixed with files - 01-25-2007 , 01:11 PM






Good morning,

Currently my company is in the process of moving from an Oracle to a
Postgres environment. One of the challenges we're facing is handling
the loading of fixed width data files into Postgres. In Oracle we
could define the columns in a control file, but I'm having trouble
figuring that out in Postgres. Delimited files are no problem, and the
copy command works for most of our needs, but is there not a native
way to import fixed width data into postgres? I'd prefer to not right
a script to read the file and make it delimited, then have to load it,
as the files we are loading contain millions of records.

Anyone have any thoughts or dealt with this previously? Am I going to
be forced to right a parser script in perl or python to convert the
file from fixed width to delimited?

Thanks for your help.


Reply With Quote
  #2  
Old   
jpd
 
Posts: n/a

Default Re: Loading fixed with files - 01-27-2007 , 04:09 AM






Begin <1169748670.135917.62540 (AT) s48g2000cws (DOT) googlegroups.com>
On 2007-01-25, David McNelis <dmcnelis (AT) gmail (DOT) com> wrote:
Quote:
Currently my company is in the process of moving from an Oracle to a
Postgres environment. One of the challenges we're facing is handling
the loading of fixed width data files into Postgres.
Why? Is oracle somehow bound to output fixed width data?


Quote:
In Oracle we could define the columns in a control file, but I'm
having trouble figuring that out in Postgres. Delimited files are no
problem, and the copy command works for most of our needs, but is
there not a native way to import fixed width data into postgres?
Not that I know of.


Quote:
I'd prefer to not right a script to read the file and make it
delimited, then have to load it, as the files we are loading contain
millions of records.
It may be a better idea to write scripts instead. Note that if using
unix it is easy to use pipes to avoid intermediate storage, and the
extra work an efficient script does is neglible compared to the work the
database does inserting the data.


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.