We help IT Professionals succeed at work.

Import Fixed Length File into PostgreSQL Database

FreightTrain
FreightTrain asked
on
445 Views
Last Modified: 2011-09-20
I need to Import a Fixed Length File into PostgreSQL Database.  Preferrably I need to create a function or stored proc that can be ran periodically when receiving a new data file.  Eventually, I would like to be able to do this via an automated script.  Please help, I am new to PostgreSQL and come from a SQL Server DTS background...
Comment
Watch Question

CERTIFIED EXPERT

Commented:
If you can cope with the Large Object Type then see.
file:///usr/share/doc/postgresql-8.2.3/html/lo-examplesect.html

Author

Commented:
Where is this file at?  I looked in my local postgresql folder for this html file, but could not locate it...
CERTIFIED EXPERT

Commented:
Client-Side functions lo_import lo_export may be just the feature you are looking for.

Author

Commented:
Once the file is in the database, is there a way to break it up into separate columns and then use it to poulate several columns within a table?

Do you have an example of how this works?
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.