PostgreSQL Sensitivity to field case

Source: Internet
Author: User
Tags lowercase postgresql

Origin
Iso=> \d+test; Table"public.test"Column| Type | Modifiers | Storage |Description--------+-----------------------+-----------+----------+-------------No| Character varying (32) | notnull | Extended |Name| Text | notnull | Extended |Indexes:"Test_pkey"PRIMARY KEY, Btree (No,"Name") has Oids:noiso= = INSERT INTO Test (no, Name) VALUES ("123","Jihite"); Error:column"name"of relation"Test"Does notExistline1:insert into Test (no, Name) VALUES ("123","Jihite"); ^

When inserting the table, I am prompted that I do not have the field ' name ', but I am clearly writing ' name ', can be a closer look, people are suggesting that there is no Name. This is strange, I entered the uppercase ' n ', why the hint is lowercase ' n '.

Solution

Because PostgreSQL is case-sensitive, and the SQL statement is converted to lowercase by default, everything is converted to name, whether I write name or name or name.

Then how to crack it, after all, the people actually have the name field, plus double quotation marks on the line. See Example

" Name ") VALUES ('123'jihite'1

PostgreSQL Sensitivity to field case

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.