agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedInserting ' into a Postgres DB?
2+ messages / 2 participants
[nested] [flat]
* Inserting ' into a Postgres DB?
@ 1996-01-14 09:58 Bruce Ide <root@greyfox.org>
0 siblings, 1 reply; 2+ messages in thread
From: Bruce Ide @ 1996-01-14 09:58 UTC (permalink / raw)
To: legacy
Anyone know how to insert a ' into a Postgres DB? Can you just \ escape
it? I seem to remember trying a couple of things and they didn't work and
I didn't see it in the docs anywhere.
-----------------------------------
Bruce Ide greyfox@gate.net or greyfox@vnet.net
http://199.170.0.111/homepage.html
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Inserting ' into a Postgres DB?
@ 1996-01-15 07:03 Jolly Chen <jolly@postgres.Berkeley.EDU>
parent: Bruce Ide <root@greyfox.org>
0 siblings, 0 replies; 2+ messages in thread
From: Jolly Chen @ 1996-01-15 07:03 UTC (permalink / raw)
To: Bruce Ide <root@greyfox.org>; +Cc: legacy
> Anyone know how to insert a ' into a Postgres DB? Can you just \ escape
> it? I seem to remember trying a couple of things and they didn't work and
> I didn't see it in the docs anywhere.
>
either '' or \' should work. There seems to be a small bug in the
corner case of ''''. See examples below:
jolly=> create table testTBL (f1 text);
CREATE
jolly=> insert into testTBL values ('This is Jolly''s test');
INSERT 1140266
jolly=> insert into testTBL values ('\'');
INSERT 1140267
jolly=> select * from testTBL;
---------------
| f1 |
---------------
| This is Jolly's test|
---------------
| ' |
---------------
jolly=> insert into testTBL values ('''');
INSERT 1140268
jolly=> select * from testTBL;
---------------
| f1 |
---------------
| This is Jolly's test|
---------------
| ' |
---------------
| |
---------------
jolly=> insert into testTBL values (' '' ');
INSERT 1140269
jolly=> select * from testTBL;
---------------
| f1 |
---------------
| This is Jolly's test|
---------------
| ' |
---------------
| |
---------------
| ' |
---------------
- Jolly
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1996-01-15 07:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1996-01-14 09:58 Inserting ' into a Postgres DB? Bruce Ide <root@greyfox.org>
1996-01-15 07:03 ` Jolly Chen <jolly@postgres.Berkeley.EDU>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox