pgAdmin Fuzzy SQL support (Gsoc idea)

Application for Summer of Code 2008: Christian J. Wong Cruz


Fuzzy logic applied to SQL queries allows relax the relational model including some restrictions which are human language-like.

I will introduce some features to pgAdmin III in order to incorporate fuzzy logic into PostgreSQL queries. These includes a Fuzzy SQL parser, a Graphical Query Builder to specify the fuzzy queries without facing the Fuzzy SQL syntax and a Trapezoidal Distribution Manager which allow define some restrictions for querying some table attributes.


I would divide this project into three tasks to complete, all with the same goal: Allow Fuzzy Queries over the stored data.

The major task I would like to contribute is the implementation of a Fuzzy SQL parser which will allow running fuzzy queries over PostgreSQL data attributes. The attributes are classified into four types: (i) crisp attributes: current implementation, (ii) allow crisp and fuzzy attributes over a sorted domain (ie. bigger), (iii) attributes defined over a discrete domain non ordered with a similarity relationship (ie. red-haired, blond), (iv) is the same as (iii) but without the similarity relationship. In this step I will implement Fuzzy attributes (iii).

The second task will be the Trapezoidal Distribution Manager which will relate the trapeze name, column name, table name, and the trapeze limits. The trapeze values will be stored in a table linking to PG_ATTRIBUTE (ATTRELID and ATTNUM). This task needs to be implemented as GUI in order to bring the abstraction on defining the rule. There are two ideas for implementing this task: (i) the user fill a form with the trapeze values – text form, (ii) the user will select the table and column for the trapeze and will define the trapeze limits in a graphic trapeze.

The last item is a Graphical Query Builder which will allow specify the fuzzy queries without facing the Fuzzy SQL syntax. It can complement the PostgreSQL idea about ‘A graphical query builder’ but will not be only for SQL queries. The GUI will allow the following tasks: (i) select the attributes of the response, (ii) select the restrictions – logical and/or fuzzy. It’s also necessary to include groups, order, subqueries and other things. It must have the response query as part of the output.

Profit for PostgreSQL

  1. With Fuzzy Queries into PostgreSQL and the Graphical Query Builder pgAdmin will be a powerful database manager tool for non developers and for inexpert users.
  2. With a Graphical Query Builder, it will be easy to develop complex queries for PostgreSQL users.

Success Criteria

  • Implement the tasks described above, the parser must be tested carefully.
  • The GUI must be user friendly and intuitive, a complex interface will discourage users to use this functionality

Project Schedule and Deliverables

The Project Schedule will be as follows:

  • Publish my goals to the PostgreSQL community and try to get some feedback and suggestions on my plans. Know my mentors, read documentation, get familiar with the specific pgAdmin internals that I require for my work. (until end of May)
  • Implement all tasks in the order they are specified above. Both, the first and the second task will be implemented between May 26 and June 16, the third task will be implemented between June 16 to July 7 week.
  • Test all features. This will begin as soon as one component is finished and should be completed by the mid of August.

I will try to implement things so that they can be used despite they are not completely finished and I should present a report of pgAdmin internals before May 26, the parser for the first task, the Trapezoidal Distribution Manager for the second task and the Graphical Query Builder for the last task. All the deliverables should be integrated to pgAdmin.


I am a last year undergraduated student in Computer Science at San Agustín National University (Arequipa, Perú).

As part of my course work I have developed latex parsers, SQL parsers, fuzzy SQL parsers and a Jay parser (Jay is a subset of the C programming language), and currently I am developing a wiki-based parser for web sites content.

I have deeply studied fuzzy logic with SQL and developed a Fuzzy Queries library which runs on Java and is fully compatible with JDBC, then this framework was published in the proceedings of the Peruvian Computer (JPC) Week at Trujillo-PERÚ on November 2007. This is basically the idea of the parser. You can find all the JPC-papers in this link:

I’ve participated in two ICPC-ACM contest (2007-2008) representing my University and I am familiar with C/C++/Java and others programming languages, I am also familiar with PostgreSQL, and GTK and QT.

For all above reasons I think that I will succeed in providing the mentioned features for pgAdmin and PostgreSQL in general.

This entry was published on March 26, 2008 at 2:17 pm. It’s filed under Ciencias de la Computación, Google Summer of Code and tagged , , , , , . Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: