Re: non-standard escapes in string literals

From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
To: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Andrew Pimlott" <pimlott(at)idiomtech(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "F Harvell" <fharvell(at)fts(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: non-standard escapes in string literals
Date: 2002-06-03 15:25:10
Message-ID: 5.1.0.14.1.20020603231833.02fc5490@192.228.128.13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 01:20 PM 6/3/02 +0200, Zeugswetter Andreas SB SD wrote:
> > for two things, one for escaping single quotes and for escaping standard
> > C characters, like \n. While we can use the standard-supported '' to
> > insert single quotes, what should we do with \n? The problem is
> > switching to standard ANSI solution reduces our functionality.
>
>The problem imho is, that this (no doubt in many cases valuable)
>feature reduces the functionality from the ANSI SQL perspective.
>Consider a field that is supposed to store Windows filenames,
>nam_file='C:\node1\resend\b.dat' :-)
>
>Thus I think a GUC to turn off all escaping except '' would be valuable.

With current behaviour 'C:\node1\resend\b.dat' can be quoted as
'C:\\node1\\resend\\b.dat'

But for the ANSI standard how does one stuff \r\n\t and other control
characters into the database?

If there's no way other than actually sending the control characters then
that is a bad idea especially from a security viewpoint.

Cheerio,
Link.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2002-06-03 16:02:52 Re: GOODS - a sensational public domain database backend
Previous Message Jason Tishler 2002-06-03 14:29:57 Re: HEADS UP: Win32/OS2/BeOS native ports