From: | 咸🐟 <2437705447(at)qq(dot)com> |
---|---|
To: | Japin Li <japinli(at)hotmail(dot)com> |
Cc: | Daniel Gustafsson <daniel(at)yesql(dot)se>, Jet Zhang <jet(dot)cx(dot)zhang(at)hotmail(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | 回复: Bug of psql meta-command \sf & \sv |
Date: | 2023-09-28 02:09:21 |
Message-ID: | tencent_B0FA5FAF0F5A0FDE1ED77A086ABBBDD1FC05@qq.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
I think there is a problem with this comparison.
\sf test; is not equal to \sf "test;"
should test \sf "test;";
postgres=# cretae table "tB"(a int, b int);
2023-09-28 09:50:41.637 CST [1480913] ERROR: syntax error at or near "cretae" at character 1
2023-09-28 09:50:41.637 CST [1480913] STATEMENT: cretae table "tB"(a int, b int);
ERROR: syntax error at or near "cretae"
LINE 1: cretae table "tB"(a int, b int);
^
postgres=# create table "tB"(a int, b int);
CREATE TABLE
postgres=# select * from tB;
2023-09-28 09:50:57.196 CST [1480913] ERROR: relation "tb" does not exist at character 15
2023-09-28 09:50:57.196 CST [1480913] STATEMENT: select * from tB;
ERROR: relation "tb" does not exist
LINE 1: select * from tB;
^
postgres=# select * from tb;
2023-09-28 09:51:00.053 CST [1480913] ERROR: relation "tb" does not exist at character 15
2023-09-28 09:51:00.053 CST [1480913] STATEMENT: select * from tb;
ERROR: relation "tb" does not exist
LINE 1: select * from tb;
^
postgres=# select * from "tB";
a | b
---+---
(0 rows)
In PostgreSQL, tB is not equal to "tB"
咸?
2437705447(at)qq(dot)com
------------------ 原始邮件 ------------------
发件人: "Japin Li" <japinli(at)hotmail(dot)com>;
发送时间: 2023年9月27日(星期三) 晚上10:16
收件人: "咸🐟"<2437705447(at)qq(dot)com>;
抄送: "Daniel Gustafsson"<daniel(at)yesql(dot)se>;"Jet Zhang"<jet(dot)cx(dot)zhang(at)hotmail(dot)com>;"pgsql-bugs"<pgsql-bugs(at)lists(dot)postgresql(dot)org>;
主题: Re: Bug of psql meta-command \sf & \sv
On Wed, 27 Sep 2023 at 20:35, 咸🐟 <2437705447(at)qq(dot)com> wrote:
> https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
> I don't think this meets the documentation's definition of an identifier.&nbsp; Semicolons should not be used this way here.(Excuse me, I need to test the email function.)
>
In PostgreSQL, quoted identifiers can contain any character, except the
character with code zero. For example:
postgres=# CREATE table "<>!(at)#$%^&*()" ("*&-=+" int, "?>.,\/" text);
CREATE TABLE
postgres=# \d "<>!(at)#$%^&*()"
Table "public.<>!(at)#$%^&*()"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
*&-=+ | integer | | |
?>.,\/ | text | | |
postgres=# INSERT INTO "<>!(at)#$%^&*()" VALUES (1, 'hello world');
INSERT 0 1
postgres=# SELECT * FROM "<>!(at)#$%^&*()";
*&-=+ | ?>.,\/
-------+-------------
1 | hello world
(1 row)
--
Regrads,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2023-09-28 02:27:34 | Re: FW: Query execution failure |
Previous Message | Tom Lane | 2023-09-28 01:06:13 | Re: FW: Query execution failure |