Re: [SQL] Problem with phone list.

2007-08-16 Thread Mike Diehl
Yup, that did it. I don't know why I made it harder than it had to be. Thank you. Mike. On Wednesday 15 August 2007 02:58:22 pm Fernando Hevia wrote: Try this: Select * from view v1 where duration = (select max(duration) from view v2 where v2.phone_number = v1.phone_number) You could

[SQL] Starting autovacuum in postgresql-8.1.9

2007-08-16 Thread Jean-David Beyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am running Red Hat Enterprise Linux 5 and postgresql-8.1.9-1.el5 (c.). It seems autovacuum would be a good idea, but I cannot see how to start it, mainly because I cannot find it. There are autovacuum settings in postgresql.conf, but they are all

Re: [SQL] Starting autovacuum in postgresql-8.1.9

2007-08-16 Thread Alvaro Herrera
Jean-David Beyer wrote: I am running Red Hat Enterprise Linux 5 and postgresql-8.1.9-1.el5 (c.). It seems autovacuum would be a good idea, but I cannot see how to start it, mainly because I cannot find it. There are autovacuum settings in postgresql.conf, but they are all commented out.

Re: [SQL] Problem with phone list.

2007-08-16 Thread Fernando Hevia
--- Michael Glaesemann wrote: SELECT DISTINCT ON (phone_number) phone_number, call_duration, id FROM calls ORDER BY phone_number , call_duration DESC; Wasn't acquainted with DISTINCT ON (column). I found it to be many times faster than other suggestions using JOIN. Cheers,

[SQL] SUPERUSER vs CREATEUSER causes foul 'code smell'

2007-08-16 Thread Joshua_Kramer
Hello, In the pg_users view - is there a way to differentiate between a role with SUPERUSER priveleges, and a user who merely has the CREATEUSER flag? If I want to create a role who can create other roles, but not have other SUPERUSER priveleges - how can I do that? Cheers, -J

Re: [SQL] SUPERUSER vs CREATEUSER causes foul 'code smell'

2007-08-16 Thread Michael Glaesemann
On Aug 16, 2007, at 10:36 , Joshua_Kramer wrote: In the pg_users view - is there a way to differentiate between a role with SUPERUSER priveleges, and a user who merely has the CREATEUSER flag? If I want to create a role who can create other roles, but not have other SUPERUSER priveleges

Re: [SQL] SUPERUSER vs CREATEUSER causes foul 'code smell'

2007-08-16 Thread Rodrigo De León
On 8/16/07, Joshua_Kramer [EMAIL PROTECTED] wrote: In the pg_users view - is there a way to differentiate between a role with SUPERUSER priveleges, and a user who merely has the CREATEUSER flag? select * from pg_roles; If I want to create a role who can create other roles, but not have other

Re: [SQL] SUPERUSER vs CREATEUSER causes foul 'code smell'

2007-08-16 Thread Peter Eisentraut
Am Donnerstag, 16. August 2007 17:36 schrieb Joshua_Kramer: In the pg_users view - is there a way to differentiate between a role with SUPERUSER priveleges, and a user who merely has the CREATEUSER flag? No, because they are the same. If I want to create a role who can create other roles, but

Re: [SQL] SUPERUSER vs CREATEUSER causes foul 'code smell'

2007-08-16 Thread Tom Lane
=?UTF-8?Q?Rodrigo_De_Le=C3=B3n?= [EMAIL PROTECTED] writes: On 8/16/07, Joshua_Kramer [EMAIL PROTECTED] wrote: If I want to create a role who can create other roles, but not have other SUPERUSER priveleges - how can I do that? create role foo createrole login password 'foo'; CREATEROLE