From: | Aaron Bingham <bingham(at)cenix-bioscience(dot)com> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | dananrg(at)yahoo(dot)com, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Fabian Pascal and RDBMS deficiencies in fully implementing |
Date: | 2006-06-12 09:46:46 |
Message-ID: | 448D3806.8060307@cenix-bioscience.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
Aaron Bingham wrote:
> David Fetter wrote:
>
>> In SQL, you can do this (this example condensed from Libkin's
>> "Expressive Power of SQL" on the page above):
>>
>> SELECT
>> (SELECT count(*) FROM table_1) <
>> (SELECT count(*) FROM table_2)
>> AS "Can't compare cardinalities in first order logic";
>>
>> Note the name of the output column. It's important and true, as you
>> can verify if you care to do your homework on foundations of
>> mathematics. Relational algebra is a subset of first-order logic
>> <http://en.wikipedia.org/wiki/Relational_algebra>, and as a direct
>> consequence, you can't do this simple but interesting thing with it.
>>
>>
> I must be missing something important. What aspect of the above query
> is supposedly impossible in relational algebra and/or relational
> calculus?
Having looked at this again, I now see that your statement above is
strictly correct, but misleading. Relational algebra consists of a
limited number of operators on relations. As such, relational algebra
says nothing about aggregate functions such as COUNT, or how to build a
relation from scaler values. Relational algebra is, however, only part
of the relational model as defined by Date, and Tutorial D includes all
the previsions we need to re-write the above query. The above query
could be expressed in Tutorial D more-or-less as follows (I'm not sure
if arbitrary strings are allowed as column names in Tutorial D, but
that's beside the point):
RELATION { TUPLE { "Can't compare cardinalities in first order logic"
(COUNT(table_1) < COUNT(table_2)) } }
Placing the result of the comparison in a relation seems unnecessary,
but I have done so for equivalence to your example. Or did I miss the
point?
Regards,
--
--------------------------------------------------------------------
Aaron Bingham
Senior Software Engineer
Cenix BioScience GmbH
--------------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Greg | 2006-06-12 09:50:41 | Re: Best security practices for installing pgSQL with my software |
Previous Message | Gregory S. Williamson | 2006-06-12 09:27:24 | Re: Help with storing spatial (map coordinates) data? |
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2006-06-12 11:12:11 | pg_get_viewdef - opclass |
Previous Message | Aaron Bingham | 2006-06-12 09:08:55 | Re: Fabian Pascal and RDBMS deficiencies in fully implementing |