Re: C++ -> C : Module for converting the WHERE clause to the canonical form with PostgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "St Valentine" <valentinest(at)ukr(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: C++ -> C : Module for converting the WHERE clause to the canonical form with PostgreSQL
Date: 2006-01-13 15:24:30
Message-ID: 25252.1137165870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"St Valentine" <valentinest(at)ukr(dot)net> writes:
> That module is writen in the C++ langguage, how can i connect it to
> the PostgreSQL sources?

Convert it to C ;-) Seriously, I think this would be a major pain in
the neck to do --- there are various gotchas like the system headers not
being C++-clean. Why don't you just resurrect the qual canonicalization
logic that existed in src/backend/optimizer/prep/prepqual.c not too long
ago?

> In our project we must to compare
> queries. Beacause of the same query can be writen in different forms,
> so to compare queries we must to convert them to the same form of
> presentation.

I find this argument fairly dubious, though, as there are plenty of ways
to write the same query differently. Forcing the condition into CNF or
DNF will fix only some of them.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message kevin brintnall 2006-01-13 15:52:30 Re: GRANT/REVOKE column-level privileges
Previous Message Tom Lane 2006-01-13 15:04:10 Re: GRANT/REVOKE column-level privileges