Re: [SQL] ' escape

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: mancinel(at)univaq(dot)it (Fabio Mancinelli)
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] ' escape
Date: 1998-12-13 04:33:18
Message-ID: 199812130433.XAA14165@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> Hello all
>
> I have a question. When I create a table I cannot use any escape to put a
> ' character in the default field definition.
>
> CREATE TABLE Test (name varchar(128) default 'Something with '' into');
>
> Fails. I've tried also other alternatives :
> default "Something with ' into"
> default "Something with '' into"
> default 'Something with \' into'
> default 'Something with \27 into'
> default 'Something with \0x27 into'
>
> Everything fails.
>
> How can I set a default with a string containing a ' ?
>
> Thank you all.

Added to TODO:

* DEFAULT handles single quotes in value by requiring too many quotes

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

  • ' escape at 1998-12-07 15:31:31 from Fabio Mancinelli

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1998-12-13 17:14:10 Re: [SQL] char type seems the same as char(1)
Previous Message Bruce Momjian 1998-12-13 03:41:09 Re: [SQL] char type seems the same as char(1)