Re: Is there a bug in psql? (SELECT ''';)

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Wen Yi <896634148(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there a bug in psql? (SELECT ''';)
Date: 2023-05-31 13:17:26
Message-ID: ZHdI5hdmlRiYrpWC@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message peter.borissow@kartographia.com 2023-05-31 13:44:35 Hash Index on Partitioned Table
Previous Message Bruce Momjian 2023-05-31 11:00:10 Re: Pg 16: will pg_dump & pg_restore be faster?