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?

More than 1 year has passed since last update.

CHECKという名のスキーマは作成できない(方法はある)

0
Posted at

結論

 予約語をそのままCREATE SCHEMA文に記述すると、弾かれることがある。
 例えば CHECK というキーワードは、PostgreSQL 14のドキュメント「付録C SQLキーワード」に依ると予約語として扱われているため、CREATE SCHEMA CHECK;では通らない。

 どうしてもCHECKでスキーマ作成したい場合には、

create schema "check";

などと二重引用符で括ると通る。

 なお、こうやって作成すると、"check".t_foo_bar_bazみたいなアクセス方法になることに注意。常に二重引用符で括ってあげなくてはいけなくなる。

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?