The table name raised by PostgreSQL when creating the user table uppercase and double quotation marks issues

Source: Internet
Author: User
Tags postgresql

In PostgreSQL ,user is a reserved word.

If you want to create a user table, you may encounter some problems!

  

As you can see, there is no way to create a user table .

You might say, I just don't have a double quote "" to enclose the uppercase table name, yes!

When I use "" to enclose the name of the table in uppercase, the problem is solved!

  

But, it 's not over yet!

What if I didn't create a user table , but something else like the U-seless table?

  

You will see that the useless table can be created, except that the table name is automatically converted to lowercase .

This should be followed by the standard SQL rules.

If I want to query the user table , how do I write its table name?

  

You will find that the results are different!

So here's the conclusion that you can draw:

When the table name of the table you want to create needs to be capitalized, enclose it in double quotation marks.

In the future as long as it is related to the operation of the table, you have to use "" to enclose the table name , note that the English state double quotation marks !

Reprint Please specify source: http://www.cnblogs.com/ficow/p/6612484.html

  

The table name raised by PostgreSQL when creating the user table uppercase and double quotation marks issues

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.