pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Inserting a tab character
4+ messages / 4 participants
[nested] [flat]

* Inserting a tab character
@ 2003-02-05 03:39 Luke Pascoe <luke.p@kmg.co.nz>
  2003-02-05 03:54 ` Re: Inserting a tab character Matthew Horoschun <mhoroschun@canprint.com.au>
  2003-02-05 07:59 ` Re: Inserting a tab character Ludwig Lim <lud_nowhere_man@yahoo.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Luke Pascoe @ 2003-02-05 03:39 UTC (permalink / raw)
  To: pgsql-sql

I have a table which defines various possible file delimiters (CHAR(1) NOT
NULL), for the moment it'll only contain comma and tab. Inserting a comma is
easy, but inserting a tab is proving somewhat more difficult.

How do I do it in 'psql'?

Luke Pascoe.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inserting a tab character
  2003-02-05 03:39 Inserting a tab character Luke Pascoe <luke.p@kmg.co.nz>
@ 2003-02-05 03:54 ` Matthew Horoschun <mhoroschun@canprint.com.au>
  1 sibling, 0 replies; 4+ messages in thread

From: Matthew Horoschun @ 2003-02-05 03:54 UTC (permalink / raw)
  To: Luke Pascoe <luke.p@kmg.co.nz>; +Cc: pgsql-sql

Hi Luke.

On Wednesday, February 5, 2003, at 02:39  PM, Luke Pascoe wrote:

> I have a table which defines various possible file delimiters (CHAR(1) 
> NOT
> NULL), for the moment it'll only contain comma and tab. Inserting a 
> comma is
> easy, but inserting a tab is proving somewhat more difficult.
>
> How do I do it in 'psql'?

insert into test values( '\t' );

appears to work...


Matt.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inserting a tab character
  2003-02-05 03:39 Inserting a tab character Luke Pascoe <luke.p@kmg.co.nz>
@ 2003-02-05 07:59 ` Ludwig Lim <lud_nowhere_man@yahoo.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Ludwig Lim @ 2003-02-05 07:59 UTC (permalink / raw)
  To: Luke Pascoe <luke.p@kmg.co.nz>; +Cc: pgsql-sql


--- Luke Pascoe <luke.p@kmg.co.nz> wrote:
> I have a table which defines various possible file
> delimiters (CHAR(1) NOT
> NULL), for the moment it'll only contain comma and
> tab. Inserting a comma is
> easy, but inserting a tab is proving somewhat more
> difficult.
> 
> How do I do it in 'psql'?
> 

  --> Try using '\t' for tab.
Example :
   INSERT INTO table1(f1) values ('\t');

   I'm not sure if inserting a TAB character will
cause some side-effects for commands like COPY FROM /
TO since these commands use tab to delimit fields.

Hope that helps,

ludwig

Hope that helps,
ludwig.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inserting a tab character
@ 2003-02-05 14:07 Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 0 replies; 4+ messages in thread

From: Christoph Haller @ 2003-02-05 14:07 UTC (permalink / raw)
  To: pgsql-sql

>
> --- Luke Pascoe <luke.p@kmg.co.nz> wrote:
> > I have a table which defines various possible file
> > delimiters (CHAR(1) NOT
> > NULL), for the moment it'll only contain comma and
> > tab. Inserting a comma is
> > easy, but inserting a tab is proving somewhat more
> > difficult.
> >
> > How do I do it in 'psql'?
> >
>
>   --> Try using '\t' for tab.
> Example :
>    INSERT INTO table1(f1) values ('\t');
>
>    I'm not sure if inserting a TAB character will
> cause some side-effects for commands like COPY FROM /
> TO since these commands use tab to delimit fields.
>
If you want to be on the safe side on COPY commands,
you could change to BYTEA type.
'\t' still works on INSERT, only on retrieval it would show up as
'\011'.

Regards, Christoph





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-02-05 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-05 03:39 Inserting a tab character Luke Pascoe <luke.p@kmg.co.nz>
2003-02-05 03:54 ` Matthew Horoschun <mhoroschun@canprint.com.au>
2003-02-05 07:59 ` Ludwig Lim <lud_nowhere_man@yahoo.com>
2003-02-05 14:07 Re: Inserting a tab character Christoph Haller <ch@rodos.fzk.de>

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