Detailed explanation of adding keywords in PostgreSQL syntax, detailed explanation of postgresql

Source: Internet
Author: User
Tags keyword list postgresql syntax

Detailed explanation of adding keywords in PostgreSQL syntax, detailed explanation of postgresql

Add keywords in PostgreSQL syntax

When PostgreSQL's background process Postgres receives the query statement, it first passes it to the query analysis module for lexical, syntax, and semantic analysis.

Add keywords in the parser Syntax Parsing module.

Introduction to several core files

Source File Description
Gram. y Define the syntax structure. After bison is compiled, generate gram. y and gram. h.
Scan. l Define the lexical structure. After flex is compiled, scan. c is generated.
Kwlist. h Keyword list, which needs to be sorted in order
Check_keywords.pl In linux, it will be called for keyword check (Order, legitimacy, etc)

Add keywords in syntax

  1. In gram. y, % token <keyword> is added with the keyword PARTITIONS.
  2. Add the keyword PARTITIONS to the reserved_keyword segment of the gram. y file.
  3. Kwlist. h file, add statement: PG_KEYWORD ("partitions", PARTITIONS, UNRESERVED_KEYWORD)

The above is the keyword added in the PostgreSQL syntax. If you have any questions, please leave a message or go to the community on this site for discussion. Thank you for reading this article and hope to help you. Thank you for your support for this site!

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.