0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

初めに

Qiita Engineer Festa 2024に参加中。完走目指してます。
他のメタコマンドについては以下から読んでください。

\errverboseとは

最も最近のサーバのエラーメッセージを最大の冗長さ、つまりVERBOSITYverboseに、そしてSHOW_CONTEXTalwaysに設定されているかのようにして、繰り返します。

\errverboseについて

試してみた

存在しないテーブルを参照してみる

postgres=# \dt
           List of relations
 Schema |   Name    | Type  |  Owner   
--------+-----------+-------+----------
 public | sales     | table | postgres
 public | test      | table | postgres
 public | test_data | table | postgres
 public | users     | table | postgres
(4 rows)
postgres=# select * from table;
ERROR:  syntax error at or near "table"
LINE 1: select * from table;

\errverboseを使ってみる

postgres=# \errverbose
ERROR:  42601: syntax error at or near "table"
LINE 1: select * from table;

LOCATION:  scanner_yyerror, scan.l:1188

LOCATION: scanner_yyerror, scan.l:1188でエラーの発生箇所(PostgreSQL側)を教えてくれています。.lと言うのは初めて見たけどLex(レックス)という。

まとめ

PostgreSQLのソースを理解するのに使えそう。
また、ソースを理解している人がどこで起きているエラーなのかで原因特定の方法が変わってきそうだなと思いました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?