agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Osborn, Marty <marty.osborn@rsa.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: Setting the Field Separator in PSQL
Date: Tue, 07 Apr 2015 14:57:02 -0700
Message-ID: <552452AE.3060302@aklaver.com> (raw)
In-Reply-To: <CAKFQuwbey8=xvoFqYofYVTRrnHKbdO4CVji4poGuevKKSzEi6g@mail.gmail.com>
References: <8CB6E5A8E0D688459585A6F52093BC250EBE18@MX104CL02.corp.emc.com>
	<CAKFQuwa7dk5WUc9OPRuVTdxTmqv0TPRSFHKXpo1oGRr8V4xYXg@mail.gmail.com>
	<CAKFQuwbey8=xvoFqYofYVTRrnHKbdO4CVji4poGuevKKSzEi6g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

On 04/07/2015 02:52 PM, David G. Johnston wrote:
> On Tue, Apr 7, 2015 at 2:48 PM, David G. Johnston
> <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>>wrote:
>
>     On Tue, Apr 7, 2015 at 1:39 PM, Osborn, Marty <marty.osborn@rsa.com
>     <mailto:marty.osborn@rsa.com>>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 <tab>​
>
>     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



view thread (6+ messages)

Message-ID: <552452AE.3060302@aklaver.com>
Permalink:  ../552452AE.3060302@aklaver.com/
Also on:    postgresql.org/message-id/552452AE.3060302@aklaver.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: adrian.klaver@aklaver.com, david.g.johnston@gmail.com, marty.osborn@rsa.com
  Subject: Re: Setting the Field Separator in PSQL
  In-Reply-To: <552452AE.3060302@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox