• icydefiance@lemm.ee
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    1 year ago

    Postgres normalizes table and field names to lowercase, unless you put them in quotes. It’s also case sensitive.

    That means if you use quotes and capital letters when creating the table, then it’s impossible to refer to that table without using quotes.

    It also means if you rename the table later to be all lowercase, then all your existing code will break.

    Still a much better database than MySQL though.

    • xmunk
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I’m quite aware… basically it means that novice devs can create a table in camelCase and query in camelCase… but you can clean it all up as long as they didn’t realize you needed double quotes.

      • icydefiance@lemm.ee
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 year ago

        Fair point. I always disliked the design because ORMs pretty much always use quotes, so an entity-first approach can create a lot of tables with capital letters if you’re not careful, which is then really annoying if you need to use raw SQL for anything.