Re: \copy combine with SELECT

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Chris <dmagick(at)gmail(dot)com>
Cc: jia ding <dingjia(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: \copy combine with SELECT
Date: 2006-03-17 16:11:42
Message-ID: 20060317161142.GA7887@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 17, 2006 at 10:45:16AM +1100, Chris wrote:
> Doesn't look like \copy lets you specify which fields to include though.

Ofcourse it does, you just need to use parenthesis. From the manpage:

\copy table [ ( column_list ) ] { from | to } filename | stdin | stdout
[ with ] [ oids ] [ delimiter [as] 'character' ] [ null [as] 'string' ]

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-03-17 16:13:14 Re: picking the correct locale when doing initdb
Previous Message Randy Yates 2006-03-17 16:07:38 Re: Encountering NULLS in plpgsql