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'; CREATE

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, b

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 ot

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

[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] 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,

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

[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 c