参考自:
https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html
中的4.1.2.4. Dollar-quoted String Constants部分。
大概意思是:$highgolei$t$highgolei$中的 highgolei是Tag,这Tag可以不要,于是就成了dollar dollar t dollar dollar,这个dollar dollar tdollar dollar就等于't'
这个Tag啥用?没自己研究。。。
原文链接:https://www.f2er.com/postgresql/193132.html中的4.1.2.4. Dollar-quoted String Constants部分。
大概意思是:$highgolei$t$highgolei$中的 highgolei是Tag,这Tag可以不要,于是就成了dollar dollar t dollar dollar,这个dollar dollar tdollar dollar就等于't'
这个Tag啥用?没自己研究。。。
postgres=# select count(*) from pg_class where relkind='t'; count ------- 19 (1 row) postgres=# select count(*) from pg_class where relkind=$$t$$; count ------- 19 (1 row) postgres=# select count(*) from pg_class where relkind=$SoMetag$Dianne's horse$SoMetag$; count ------- 0 (1 row) postgres=# select count(*) from pg_class where relkind=$SoMetag$t$SoMetag$; count ------- 19 (1 row) postgres=# select count(*) from pg_class where relkind=$highgo$t$highgo$; count ------- 19 (1 row) postgres=# select count(*) from pg_class where relkind=$highgolei$t$highgolei$; count ------- 19 (1 row) postgres=# select count(*) from pg_class where relkind=$highgo-lei$t$highgo-lei$; ERROR: Syntax error at or near "$" LINE 1: select count(*) from pg_class where relkind=$highgo-lei$t$hi... ^ postgres=#