Re: Backslash handling in strings

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Backslash handling in strings
Date: 2005-05-31 15:09:43
Message-ID: 20050531150943.GA31259@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, May 31, 2005 at 11:49:20 +0200,
Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> wrote:
> On Tue, 31 May 2005, Tom Lane wrote:
>
> > The case that convinced me we need to keep some sort of backslash
> > capability is this: suppose you want to put a string including a tab
> > into your database. Try to do it with psql:
> > t=> insert into foo values ('<TAB>
> > Guess what: you won't get anywhere, at least not unless you disable
> > readline. So it's nice to be able to use \t.
>
> To insert a tab using readline you can press ESC followed by TAB. This
> works as least in readline as it is setup in redhat/fedora (and readline
> can be setup in 1000 different ways so who knows how portable this is).

There are still advantages to having printable backslashed escaped characters
in strings that are saved to files. It makes it easier to see what is really
in the string and they are less likely to get accidentally munged when
editing the file or moving it between systems with different line termination
conventions.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-05-31 15:13:42 Re: ddl triggers
Previous Message Компьютерная компания реализует 2005-05-31 15:02:25 Ноутбуки б/у из США от 300 $ с гарантией в Москве (новые поступления)

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2005-05-31 21:31:16 Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}
Previous Message Bruce Momjian 2005-05-31 14:54:25 Re: Backslash handling in strings