Skip site navigation (1) Skip section navigation (2)

How to remove quotes from COPY TO result?

From: Michael Rowan <mike(dot)rowan(at)internode(dot)on(dot)net>
To: postgresql novice <pgsql-novice(at)postgresql(dot)org>
Subject: How to remove quotes from COPY TO result?
Date: 2010-07-18 04:45:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
PostgreSQL 8.4.1

I have a table "abbreviation" created as follows:

id serial NOT NULL,
full_name character varying(16),
short_name character varying(16),

I import some data from a tab delimited text file like so:

1	"STREET"		"ST"
2	"ROAD" 			"RD"

using COPY abbreviation FROM <<myfile>> 

The data is imported but I want the character columns to be stripped of the enclosing double-quotes and they are not.  What do I have to do?  


Michael Rowan

11 Kingscote Street
South Australia 5014

tel 618 8240 3993


pgsql-novice by date

Next:From: Joe ConwayDate: 2010-07-18 06:44:13
Subject: Re: How to remove quotes from COPY TO result?
Previous:From: Steve CrawfordDate: 2010-07-16 15:47:59
Subject: Re: Need help doing a CSV import

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group