Cannot access table without public.table name. Is there a way to get rid of public?

后端 未结 2 429
旧巷少年郎
旧巷少年郎 2021-01-29 10:49

I have a table named user in PostgreSQL which cannot be accessed until I specify the fully qualified name public.user.
SHOW search_path

相关标签:
2条回答
  • 2021-01-29 11:15

    Let me guess, it works if you use:

    SELECT * FROM "user";
    

    But if you try: SELECT * FROM user; it returns your current username?

    0 讨论(0)
  • 2021-01-29 11:22

    USER is a reserved word in both Postgres and standard SQL. Do not use as a table name.

    0 讨论(0)
提交回复
热议问题