[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Import Fixed Length File into PostgreSQL Database

Posted on 2007-10-04
5
Medium Priority
?
422 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...
0
Comment
Question by:FreightTrain
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:earth man2
ID: 20024477
If you can cope with the Large Object Type then see.
file:///usr/share/doc/postgresql-8.2.3/html/lo-examplesect.html
0
 

Author Comment

by:FreightTrain
ID: 20024552
Where is this file at?  I looked in my local postgresql folder for this html file, but could not locate it...
0
 
LVL 22

Expert Comment

by:earth man2
ID: 20024592
Client-Side functions lo_import lo_export may be just the feature you are looking for.
0
 

Author Comment

by:FreightTrain
ID: 20024637
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?
0
 
LVL 22

Accepted Solution

by:
earth man2 earned 2000 total points
ID: 20030529
you can read it in directly using COPY command.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question