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

2023-05-31 Thread Adrian Klaver
On 5/31/23 00:17, 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; postgres'# exit Use cont

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

2023-05-31 Thread hubert depesz lubaczewski
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'#

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

2023-05-31 Thread Marco Lechner
You have to mask the single quote: https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS Von: Wen Yi <896634...@qq.com> Gesendet: Mittwoch, 31. Mai 2023 09:17 An: pgsql-general Betreff: Is there a bug in psql? (SELECT ''';) Hi team, when I

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

2023-05-31 Thread Wen Yi
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; postgres'# exit Use control-D to quit. postgres'# \q Us