pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Wen Yi <896634148@qq.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Is there a bug in psql? (SELECT ''';)
Date: Wed, 31 May 2023 15:17:26 +0200
Message-ID: <ZHdI5hdmlRiYrpWC@depesz.com> (raw)
In-Reply-To: <tencent_27D6CDAD1699DE403EC409B96949CBB8CC0A@qq.com>
References: <tencent_27D6CDAD1699DE403EC409B96949CBB8CC0A@qq.com>

On Wed, May 31, 2023 at 03:17:14PM +0800, Wen Yi wrote:
> Hi team,
> when I learn the postgres, I try to store the ' into the database, 
> 
> but something unexpected happend.
> 
> 
> postgres=# CREATE TABLE test (str varchar);
> CREATE TABLE
> postgres=# INSERT INTO test values (''');
> postgres'# SELECT * FROM test;

In here, in prompt, you can see that it's waiting for you to end your
'-qutoed string.

You seem to expect
INSERT INTO test values (''');
to do something, which it won't as it's not full query.

What do you think this should be doing?

Best regards,

depesz






view thread (3+ messages)  latest in thread

Message-ID: <ZHdI5hdmlRiYrpWC@depesz.com>
Permalink:  ../ZHdI5hdmlRiYrpWC@depesz.com/
Also on:    postgresql.org/message-id/ZHdI5hdmlRiYrpWC@depesz.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, 896634148@qq.com
  Subject: Re: Is there a bug in psql? (SELECT ''';)
  In-Reply-To: <ZHdI5hdmlRiYrpWC@depesz.com>
  References: <tencent_27D6CDAD1699DE403EC409B96949CBB8CC0A@qq.com> <ZHdI5hdmlRiYrpWC@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox