PostgreSQL ERROR: 42P01: relation “[Table]” does not exist

前端 未结 3 1688
灰色年华
灰色年华 2021-02-13 17:27

I\'m having this strange problem using PostgreSQL 9.3 with tables that are created using qoutes. For instance, if I create a table using qoutes:

create table \"T         


        
3条回答
  •  無奈伤痛
    2021-02-13 18:29

    you have two choices: - no quotes: then everything will automatically be lowercase and non-case-sensitive - with quotes: from now on everything is case sensitive.

    i would highly recommend to NOT use quotes and make PostgreSQL behave non case sensitive. it makes life so much easier. once you get into quoting you got to use it EVERYWHERE as PostgreSQL will start to be very precise.

    some example:

       TEST = test       <-- non case sensitive
       "Test" <> Test    <-- first is precise, second one is turned to lower case
       "Test" = "Test"   <-- will work
       "test" = TEST     <-- should work; but you are just lucky.
    

    really try to avoid this kind of trickery at any cost. stay with 7 bit ascii for object names.

提交回复
热议问题