From: | Andrew Smith <laconical(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Fwd: Enhancement to SQL query capabilities |
Date: | 2016-03-18 07:00:29 |
Message-ID: | CALr=acEdA4uuDz1h9b_kCaw38yqzFwGon3axuWRV-WkoATttvg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Apologies, forgot to reply all:
> In order to get the data I want in postgres, I need to do this:
>>
>> select h.Day, h.Description, h.Month, h.Year, g.Name, r.Name from
>> Holidays h, HolidayGroup g, HolidayRegion r where h.HolidayGroup = g.Id and
>> g.HolidayRegion = r.Id
>>
>
> I suggest learning ANSI join syntax.
>
> FROM holiday h
> JOIN holidaygroup g on (h.id = g.id)
>
>
Any particular reason why? This creates a longer query string than the one
I listed and they both give the same result:
select h.Day, h.Description, h.Month, h.Year, g.Name, r.Name from Holidays
h join HolidayGroup g on h.HolidayGroup = g.id join HolidayRegion r on
g.HolidayRegion = r.id
Does using a join make the query execute faster, or is it just a 'more
accepted' query standard? I've been so used to our custom syntax that I
haven't written a 'real' SQL query in more than a decade.
>
> Even if this is something that would be committed (I have my doubts and
> generally don't think it should be) you'd still end up writing it because I
> am near certain no one else would be so inclined.
>
> Given you are not adding any new capabilities and making significant
> changes to parsing code, the barrier for entry is very high. If the syntax
> was standard then work on using meta-data to auto-resolve the joins might
> be worthy of inclusion.
>
I would have thought that being able to reduce the complexity of long SQL
statements would be seen as a new capability, but if it isn't desirable
then I'll download the code and start looking into it. At the very least
I'll probably have to provide a homebrew alternative to psql as we've got
heaps of scripts written in this syntax which will take a very long time to
port across to standard SQL.
>
> I can't find any information on the postgres website about a way to
>> submit feature requests/enhancements, only to report bugs. Is there a
>> formal mechanism to request new functionality?
>>
>>
> Most requests that are not bugs should go to -general unless one of the
> other lists seems more appropriate. Discussions about patches occur on
> -hackers.
>
>
Thanks, will keep that in mind for my next dumb idea :-)
From | Date | Subject | |
---|---|---|---|
Next Message | Martin Edlman | 2016-03-18 07:20:30 | Re: Fwd: Enhancement to SQL query capabilities |
Previous Message | David G. Johnston | 2016-03-18 05:54:55 | Re: Enhancement to SQL query capabilities |