Parser - Query Analyser - Mailing list pgsql-hackers

From Michael Giannakopoulos
Subject Parser - Query Analyser
Date
Msg-id CAAADf7+eEi-XS+mdCR42y9GVdPB6QiBnObYq-e6tpsfF_du+GQ@mail.gmail.com
Whole thread Raw
Responses Re: Parser - Query Analyser  (David Johnston <polobo@yahoo.com>)
Re: Parser - Query Analyser  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Parser - Query Analyser  (Любен Каравелов <karavelov@mail.bg>)
Re: Parser - Query Analyser  (Craig Ringer <craig@2ndQuadrant.com>)
List pgsql-hackers
Hello guys,

My name is Michail Giannakopoulos and I am a graduate student at University of Toronto. I have no previous experience in developing a system like postgreSQL before.

What I am trying to explore is if it is possible to extend postgreSQL in order to accept queries of the form:

Select function(att1, att2, att3) AS output(out1, out2, ..., outk) FROM [database_name];

where att1, att2, att3 are attributes of the relation [database_name] while output(out1, out2, out3) expresses the output that comes from 'function' and the fields that this output should have are (out1, out2, out3). What I mean is that this kind of query should return tuples that obay to the 'output(...)' schema and are produced by processing the original tuples of 'database_name' relation in attributes att1, att2 and att3.

From what I have seen I need to teak both the parser and the query analyser in order to accept this form of query. However, I do not know how to tweak these systems. Even worse I do not know where to begin from.

The manual of extending SQL did not helped me and currently I am debugging postgreSQL source code. I would appreciate if you could provide me with more resources and correct ways of how to hack inside postgreSQL files and system. For example, where do I add a new parse node, where should I change the the grammar. 

Thank you very much for all your time and all your help,
Michail

pgsql-hackers by date:

Previous
From: Markus Wanner
Date:
Subject: Re: logical changeset generation v3 - comparison to Postgres-R change set format
Next
From: Andres Freund
Date:
Subject: Re: foreign key locks