Adding a new Clause in the Source Code

Started by Stefan Wagnerover 8 years ago2 messagesgeneral
Jump to latest
#1Stefan Wagner
s_wagner1@gmx.net

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Recently I started to take a look at Postgresql on the Source Level. I wanted to extend the Parser by a simple Clause which isn&#39;t as easy as I expected.<br/>
Hence I&#39;m here asking for help. This might seem trivial for a Person which is able to answer this Question but please take a moment of your time and help a<br/>
fellow coder out.&nbsp;</div>

<div>&nbsp;</div>

<div>My Objective is to add a new Clause after the WHERE Clause in a SELECT Statement which modifys the order of my result. I allready invested some time to get familar<br/>
with the Bison part in source&#92;src&#92;backend&#92;parser so adding new Keywords seems possible. The question now is in which Files do I need to add what to make it work.<br/>
Yes this question seems a bit broad but Information I found was confusing or outdated.</div>

<div>&nbsp;</div>

<div>I would really appreciate if someone could hack me a quick example of a new clause lets call it ADDITIONAL with Keywords HIGH, LOW to order columns. I just want the construct. What<br/>
the Keywords accomplish and the Algorithm is something I&#39;m gonna try to figure out on my own. I just need to know in which File and which Line I need to enter my Code.</div>

<div>&nbsp;</div>

<div>I appreciate any help I can get and if needed I&#39;ll add some additional Information.</div>
</div></div></body></html>

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Stefan Wagner (#1)
Re: Adding a new Clause in the Source Code

On 8/14/17 04:14, Stefan Wagner wrote:

I would really appreciate if someone could hack me a quick example of a
new clause lets call it ADDITIONAL with Keywords HIGH, LOW to order
columns. I just want the construct. What
the Keywords accomplish and the Algorithm is something I'm gonna try to
figure out on my own. I just need to know in which File and which Line I
need to enter my Code.

For projects like this, figuring out all the places where to change
things is often half the work.

If I were to approach this, I would see how ORDER BY is implemented and
track all those places down and then see whether I need to make
analogous changes there.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general