Re: [SQL] [BUGS] 7.3 GROUP BY differs from 7.2

2003-02-21 Thread Tom Lane
Dan Langille <[EMAIL PROTECTED]> writes: > This is the query in question: > SELECT element_id as wle_element_id, COUNT(watch_list_id) > FROM watch_list JOIN watch_list_element >ON watch_list.id = watch_list_element.watch_list_id > WHERE watch_list.user_id = 1 > GROUP BY watch_list_el

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Peter Eisentraut
Dan Langille writes: > > SELECT element_id as wle_element_id, COUNT(watch_list_id) > >FROM watch_list JOIN watch_list_element > > ON watch_list.id = watch_list_element.watch_list_id > > WHERE > >watch_list.user_id = 1 > > GROUP BY wle_element_id This works because the first se

Re: [SQL] function defination help ..

2003-02-21 Thread Peter Eisentraut
Rajesh Kumar Mallah writes: > is it possible to get the function creation defination as produced by pg_dump > by some SQL queries on system catalogs? > > pg_func stores procsrc but i am trying to get RETURNS and the arg part also. You will need to reconstruct what pg_dump does. -- Peter Eisentr

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Dan Langille
On Fri, 21 Feb 2003, Josh Berkus wrote: > Dan, Chad, > > > I see the distinction you are making. > > > > Maybe Tom or Josh could throw out a better answer, but I think that youve > > called it one thing in your select and tried to group by it using a > > syntaticly different name. > > This looks l

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Josh Berkus
Dan, Chad, > I see the distinction you are making. > > Maybe Tom or Josh could throw out a better answer, but I think that youve > called it one thing in your select and tried to group by it using a > syntaticly different name. This looks like a bug to me. Please write it up and send it to BUG

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Dan Langille
On 21 Feb 2003 at 13:30, Chad Thompson wrote: > The same applies to group by... Sorry for the confusion. > > If the column is not in the select section of the statement, it cant group > by it. > Try this. > > SELECT element_id as wle_element_id, COUNT(watch_list_id) >FROM watch_list JOIN wat

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Chad Thompson
> On 21 Feb 2003 at 13:00, Chad Thompson wrote: > > > > > On 21 Feb 2003 at 19:18, Gaetano Mendola wrote: > > > > > > > > Hi folks, > > > > > > > > > > This query: > > > > > > > > > > SELECT element_id as wle_element_id, COUNT(watch_list_id) > > > > > FROM watch_list JOIN watch_list_element

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Dan Langille
On 21 Feb 2003 at 13:00, Chad Thompson wrote: > > On 21 Feb 2003 at 19:18, Gaetano Mendola wrote: > > > > > > Hi folks, > > > > > > > > This query: > > > > > > > > SELECT element_id as wle_element_id, COUNT(watch_list_id) > > > > FROM watch_list JOIN watch_list_element > > > > ON watc

Re: [SQL] Fw:

2003-02-21 Thread Daniel Schuchardt
Your ipc-daemon-version is to old. Download the newest version first. (1.13) Daniel ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

[SQL] How do I view triggers

2003-02-21 Thread Graham Vickrage
Hi All, I am slightly confused as to how I view what triggers I have on a certain table. select * from pg_trigger doesn't show me the trigger I have just created, but its definitely there because when I try and create it, it gives an error that it already exists. TIA Graham --

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Chad Thompson
> On 21 Feb 2003 at 19:18, Gaetano Mendola wrote: > > > > Hi folks, > > > > > > This query: > > > > > > SELECT element_id as wle_element_id, COUNT(watch_list_id) > > > FROM watch_list JOIN watch_list_element > > > ON watch_list.id = watch_list_element.watch_list_id > > >

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Dan Langille
On 21 Feb 2003 at 19:18, Gaetano Mendola wrote: > > Hi folks, > > > > This query: > > > > SELECT element_id as wle_element_id, COUNT(watch_list_id) > > FROM watch_list JOIN watch_list_element > > ON watch_list.id = watch_list_element.watch_list_id > >AND watch_list.user_

Re: [SQL] 7.3 "group by" issue

2003-02-21 Thread Gaetano Mendola
- Original Message - From: "Dan Langille" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 7:01 PM Subject: [SQL] 7.3 "group by" issue > Hi folks, > > This query: > > SELECT element_id as wle_element_id, COUNT(watch_list_id) > FROM watch_list JOIN watch_l

[SQL] 7.3 "group by" issue

2003-02-21 Thread Dan Langille
Hi folks, This query: SELECT element_id as wle_element_id, COUNT(watch_list_id) FROM watch_list JOIN watch_list_element ON watch_list.id = watch_list_element.watch_list_id AND watch_list.user_id = 1 GROUP BY watch_list_element.element_id gives this error: ERROR: Attri

Re: [SQL] good style?

2003-02-21 Thread Rafal Kedziorski
Tambet Matiisen wrote: -Original Message- From: Rafal Kedziorski [mailto:[EMAIL PROTECTED] Sent: Friday, February 21, 2003 3:30 PM To: [EMAIL PROTECTED] Subject: [SQL] good style? hi, I have 8 tables and this query: select u.users_id, m.name as mandant_name, u.login_name, u.password,

Re: [SQL] good style?

2003-02-21 Thread Tambet Matiisen
> -Original Message- > From: Rafal Kedziorski [mailto:[EMAIL PROTECTED] > Sent: Friday, February 21, 2003 3:30 PM > To: [EMAIL PROTECTED] > Subject: [SQL] good style? > > > hi, > > I have 8 tables and this query: > > select u.users_id, m.name as mandant_name, u.login_name, u.password,

Re: [SQL] good style?

2003-02-21 Thread Alan Gutierrez
In article <[EMAIL PROTECTED]>, Rafal Kedziorski wrote: > hi, > > I have 8 tables and this query: > > select u.users_id, m.name as mandant_name, u.login_name, u.password, > u.first_name, u.last_name, u.creation_date, g.name as groups_name, > ae.acl_entry_id, a.name as acl_name, p.name as permis

[SQL] function defination help ..

2003-02-21 Thread Rajesh Kumar Mallah
Hi, is it possible to get the function creation defination as produced by pg_dump by some SQL queries on system catalogs? pg_func stores procsrc but i am trying to get RETURNS and the arg part also. -- Regds Mallah Rajesh Kumar Mallah, Project Man

Re: [SQL] good style?

2003-02-21 Thread Rajesh Kumar Mallah
this kind of joining has been termed "explicit JOIN syntax" by pgsql 7.3 docs. I personally feel it makes ur SQL look uglier and complicated. i feel the WHERE caluse shud contain the genuine filters of result set not the ones which could be a part of JOIN syntax itself. (its personal view thou

[SQL] good style?

2003-02-21 Thread Rafal Kedziorski
hi, I have 8 tables and this query: select u.users_id, m.name as mandant_name, u.login_name, u.password, u.first_name, u.last_name, u.creation_date, g.name as groups_name, ae.acl_entry_id, a.name as acl_name, p.name as permission_name from mandant m, users_2_groups u2g, groups g, users u, perm

Re: [SQL] " Adding missing FROM-clause entry for table .... " problem.

2003-02-21 Thread Rajesh Kumar Mallah
Hmmm i forgot to follow up. Thanks for pointing out the relevent Docs. Regds Mallah. On Tuesday 18 February 2003 04:04 pm, Christoph Haller wrote: > > We find that if we alias a tablename and refer to that tablename in > > where cluase instead of reffering > > > to the alias it produces wrond r