Loading text files into a text attribute

From: "BARTKO, Zoltan" <bartko(dot)zoltan(at)pobox(dot)sk>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Loading text files into a text attribute
Date: 2004-04-02 05:17:14
Message-ID: 001901c41871$c360f960$0e5d10ac@antik.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello folks,

I have the following problem:

I have a bunch of text files, I want to load them into a table where each
file will be stored in one row.

Question 1: Is there any way how to do this in psql?

AFAIK the \copy command interprets \n as a new line and so I can't get it
done what I want. So I wrote a C program that parses my text files and
anywhere it sees a \n it puts \\n and then concatenates the files, etc. -
quite complicated.

Question 2: Is there a simpler way of doing this?

Thanks in advance

Zoltan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ryan Riehle 2004-04-02 05:49:43 Re: Problems compiling Apache 2.0.49 with mod_auth_pgsql
Previous Message Vinay Jain 2004-04-02 04:47:50 Create Type Problem