testdb=# INSERT INTO test VALUES (1, 'abc'); INSERT 0 1 testdb=# ERROR; ERROR: syntax error at or near "ERROR" LINE 1: ERROR; ^ testdb=# ROLLBACK; ROLLBACK testdb=# testdb=# BEGIN; BEGIN testdb=*# INSERT INTO test VALUES (1, 'abc'); INSERT 0 1 testdb=*# ERROR; ERROR: syntax error at or near "ERROR" LINE 1: ERROR; ^ testdb=!# ROLLBACK; ROLLBACK testdb=# • PostgreSQL 13
testdb=# INSERT INTO test VALUES (1, 'abc'); INSERT 0 1 testdb=# ERROR; ERROR: syntax error at or near "ERROR" LINE 1: ERROR; ^ testdb=# ROLLBACK; ROLLBACK testdb=# おわかりいただけたであろうか・・・ testdb=# BEGIN; BEGIN testdb=*# INSERT INTO test VALUES (1, 'abc'); INSERT 0 1 testdb=*# ERROR; ERROR: syntax error at or near "ERROR" LINE 1: ERROR; ^ testdb=!# ROLLBACK; ROLLBACK testdb=# • PostgreSQL 13
Informational (options: S = show system objects, + = additional detail) \d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods \db[+] [PATTERN] list tablespaces testdb-# \? (中略) Informational (options: S = show system objects, + = additional detail) \d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods \dAc[+] [AMPTRN [TYPEPTRN]] list operator classes \dAf[+] [AMPTRN [TYPEPTRN]] list operator families \dAo[+] [AMPTRN [OPFPTRN]] list operators of operator families \dAp [AMPTRN [OPFPTRN]] list procedures of operator families \db[+] [PATTERN] list tablespaces • PostgreSQL 13
Informational (options: S = show system objects, + = additional detail) \d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods \db[+] [PATTERN] list tablespaces おわかりいただけたであろうか・・・ testdb-# \? (中略) Informational (options: S = show system objects, + = additional detail) \d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods \dAc[+] [AMPTRN [TYPEPTRN]] list operator classes \dAf[+] [AMPTRN [TYPEPTRN]] list operator families \dAo[+] [AMPTRN [OPFPTRN]] list operators of operator families \dAp [AMPTRN [OPFPTRN]] list procedures of operator families \db[+] [PATTERN] list tablespaces • PostgreSQL 13
Informational (options: S = show system objects, + = additional detail) \d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods \db[+] [PATTERN] list tablespaces なんかめっさ増えてない? testdb-# \? (中略) Informational (options: S = show system objects, + = additional detail) \d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods \dAc[+] [AMPTRN [TYPEPTRN]] list operator classes \dAf[+] [AMPTRN [TYPEPTRN]] list operator families \dAo[+] [AMPTRN [OPFPTRN]] list operators of operator families \dAp [AMPTRN [OPFPTRN]] list procedures of operator families \db[+] [PATTERN] list tablespaces • PostgreSQL 13
て設定できない・・・ testdb=# CREATE INDEX data_bigm_idx ON test USING gin (data); ERROR: data type text has no default operator class for access method "gin" HINT: You must specify an operator class for the index or define a default operator class for the data type. testdb=# testdb=# \dAc gin text List of operator classes AM | Input type | Storage type | Operator class | Default? -----+------------+--------------+----------------+---------- gin | text | | gin_bigm_ops | no (1 row) testdb=# CREATE INDEX data_bigm_idx ON test USING gin (data gin_bigm_ops); CREATE INDEX testdb=# • そんなときには \dAc を叩いて Operator class を参照しよう。 にゃーん
is the PostgreSQL interactive terminal. (中略) Report bugs to <[email protected]>. $ $ ~/pgsql/pgsql-13beta1/bin/psql --help psql is the PostgreSQL interactive terminal. (中略) Report bugs to <[email protected]>. PostgreSQL home page: <https://www.postgresql.org/> $ • PostgreSQL 13
FROM '/tmp/t testdb=# COPY test FROM '/tmp/t • PostgreSQL 13 ここで水平タブを入力すると・・・ testdb=# COPY test FROM /tmp/test.dat testdb=# COPY test FROM '/tmp/test.dat'
FROM '/tmp/t testdb=# COPY test FROM '/tmp/t • PostgreSQL 13 ここで水平タブを入力すると・・・ testdb=# COPY test FROM /tmp/test.dat testdb=# COPY test FROM '/tmp/test.dat' おわかりいただけたであろうか・・・
FROM '/tmp/t testdb=# COPY test FROM '/tmp/t • PostgreSQL 13 ここで水平タブを入力すると・・・ testdb=# COPY test FROM /tmp/test.dat testdb=# COPY test FROM '/tmp/test.dat' 消える!シングルクォート! にゃーん 改善っていうか Bug-Fix に近いような気がする。 残る!シングルクォート!