Lexer issues

From: Patrick REED <patrickreed352(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Lexer issues
Date: 2020-04-13 02:46:17
Message-ID: CAJHg7sc-NExrRBPUUe8=b=NYfZ1wZqEaExT1MtyiH49cHwPtvA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I am experimenting with postgres and am wondering if there is any tutorial
on how to properly add a new command to postgres.

I want to add a new constraint on "CREATE ROLE" that requires an integer,
it has an identifier that is not a known (reserved or unreserved keyword)
in postgres, say we call it TestPatrick. In other words, I want to do this
"CREATE ROLE X TestPatrick=10". I am having an issue with having postgres
recognize my new syntax.

I have seen this video: https://www.youtube.com/watch?v=uSEXTcEiXGQ and was
able to add have my postgres compile with my added word (modified gram.y,
kwlist.h, gram.cpp etc based on the video). However, when I use my syntax
on a client session, it still doesn't recognize my syntax... Are there any
specific lexer changes I need to make? I followed the example of CONNECTION
LIMIT and tried to mimic it for Create ROLE.

Best,
Patrick

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-04-13 02:52:51 Re: pg_basebackup, manifests and backends older than ~12
Previous Message Shinoda, Noriyoshi (PN Japan A&PS Delivery) 2020-04-13 02:20:03 RE: pg_validatebackup -> pg_verifybackup?