Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.1/8.9.1) with ESMTP id SAA25815 for ; Mon, 7 Dec 1998 18:04:59 -0500 (EST) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id RAA02133; Mon, 7 Dec 1998 17:59:48 -0500 (EST) From: Bruce Momjian Message-Id: <199812072259.RAA02133@candle.pha.pa.us> Subject: Re: [SQL] ' escape In-Reply-To: from Jan Wieck at "Dec 7, 1998 10:10:10 pm" To: jwieck@debis.com Date: Mon, 7 Dec 1998 17:59:48 -0500 (EST) Cc: herouth@oumail.openu.ac.il, mancinel@univaq.it, pgsql-sql@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL47 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > > 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. > > > > Interesting bug. > > > > As a workaround, if you really need that default value, define a simple SQL > > function which returns it: > > Hmmm - bug or feature - dunno. But telling > > ... DEFAULT 'Something with '''' into' ... > > works pretty good and as I expected it, results in one single > quoute. I see the problem here: test=> create table test33 (a int,x char(10) default 'x\'y'); ERROR: parser: parse error at or near "y" -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026