Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YfbUh-0000eA-Dl for pgsql-sql@arkaria.postgresql.org; Tue, 07 Apr 2015 21:57:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YfbUg-0008Jp-S9 for pgsql-sql@arkaria.postgresql.org; Tue, 07 Apr 2015 21:57:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YfbUf-0008Hk-Ux for pgsql-sql@postgresql.org; Tue, 07 Apr 2015 21:57:14 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YfbUY-0005Il-Dc for pgsql-sql@postgresql.org; Tue, 07 Apr 2015 21:57:12 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 008B520CE1 for ; Tue, 7 Apr 2015 17:56:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 07 Apr 2015 17:57:03 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=02U9hdSM1VKn9lXyJqU1GGmA4Tw=; b=D04x3e v/Om2EKvyew5yUCJ5ceMnpyIf592eXS2whCoe7ShF+UkXqmPtMcr4k5a2vg1LjHX 2p7QVaK3kIh25oI3MiDNupCQhsRBnzSvFoU3rdsPx7TNX8gGT7qWzx+1U2mt+Xly ccu6KOmRjoF0VDk6JSJbobuEa0MXIwq1bwNos= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=02U9hdSM1VKn9lX yJqU1GGmA4Tw=; b=bXzg4MiNK6cfGi84BnAWmNYw+fLJMe0/jc9m9lc5ZblyupC KYLQ/b5qe3aWG66kx9Rt6WCKA7DbzOQzl2EmspDI6yYlAZUvTy40tSMSp7roy7q+ GoSq8Rm0/GlHk0b5dK6eU+vQE+mBwNpcD4vWOzzdLR/xq/q6tuszSuDWE9KM= X-Sasl-enc: YYU5vc9FOVEclNA4CAXODtOO7W5qIUv0/Te4ugROAlQO 1428443823 Received: from [192.168.1.2] (unknown [174.21.218.98]) by mail.messagingengine.com (Postfix) with ESMTPA id 436AFC00022; Tue, 7 Apr 2015 17:57:03 -0400 (EDT) Message-ID: <552452AE.3060302@aklaver.com> Date: Tue, 07 Apr 2015 14:57:02 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "David G. Johnston" , "Osborn, Marty" CC: "pgsql-sql@postgresql.org" Subject: Re: Setting the Field Separator in PSQL References: <8CB6E5A8E0D688459585A6F52093BC250EBE18@MX104CL02.corp.emc.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 04/07/2015 02:52 PM, David G. Johnston wrote: > On Tue, Apr 7, 2015 at 2:48 PM, David G. Johnston > >wrote: > > On Tue, Apr 7, 2015 at 1:39 PM, Osborn, Marty >wrote: > > I need to change the field separator to a tab in an input SQL > file.____ > > __ __ > > I’ve tried every combination of tab, ‘\t’, “\t”, > --field-separator=’\t’, etc, etc.____ > > __ __ > > Should it be in the command line or in the SQL file?____ > > ____ > > Any help?____ > > > > ​More context would helpful but keep in mind that within SQL the > expression: > > '\t' is a literal back-slash and a literal "t" > > E'\t' is escaped to mean ​ > > Dealing with the shell complicates the issue so if you can avoid it > I suggest that do avoid it. > > > ​I should probably have tried my own advice first, and I still haven't, > but the documentation states: > > "​""" > fieldsep > Specifies the field separator to be used in unaligned output format. > That way one can create, for example, tab- or comma-separated output, > which other programs might prefer. To set a tab as field separator, type > \pset fieldsep '\t'. The default field separator is '|' (a vertical bar). > ​"""​ > > ​So I'm not sure if this report is user-error or documentation error. A > self-contained test case would help... Well the OP was talking about an input file, so I my suspicion they are looking for something like \copy. > > David J.​ > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql