Re: [HACKERS] Extra functionality to createuser

2013-12-12 Thread Christopher Browne
On Wed, Dec 11, 2013 at 7:53 AM, Robert Haas robertmh...@gmail.com wrote: On Tue, Dec 10, 2013 at 9:55 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Tue, Dec 10, 2013 at 12:20 AM, Robert Haas robertmh...@gmail.com wrote: On Sat, Dec 7, 2013 at 11:39 PM, Amit Kapila amit.kapil...@gmail.com

Re: [HACKERS] Extra functionality to createuser

2013-12-11 Thread Robert Haas
On Tue, Dec 10, 2013 at 9:55 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Tue, Dec 10, 2013 at 12:20 AM, Robert Haas robertmh...@gmail.com wrote: On Sat, Dec 7, 2013 at 11:39 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Dec 6, 2013 at 10:31 AM, Peter Eisentraut pete...@gmx.net

Re: [HACKERS] Extra functionality to createuser

2013-12-11 Thread Amit Kapila
On Wed, Dec 11, 2013 at 6:23 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Dec 10, 2013 at 9:55 AM, Amit Kapila amit.kapil...@gmail.com wrote: Okay, the new way for syntax suggested by Peter has simplified the problem. Please find the updated patch and docs for multiple -g options.

Re: [HACKERS] Extra functionality to createuser

2013-12-10 Thread Amit Kapila
On Tue, Dec 10, 2013 at 12:20 AM, Robert Haas robertmh...@gmail.com wrote: On Sat, Dec 7, 2013 at 11:39 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Dec 6, 2013 at 10:31 AM, Peter Eisentraut pete...@gmx.net wrote: How about only one role name per -g option, but allowing the -g option

Re: [HACKERS] Extra functionality to createuser

2013-12-09 Thread Robert Haas
On Sat, Dec 7, 2013 at 11:39 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Dec 6, 2013 at 10:31 AM, Peter Eisentraut pete...@gmx.net wrote: On Wed, 2013-11-20 at 11:23 -0500, Christopher Browne wrote: I note that similar (with not quite identical behaviour) issues apply to the user

Re: [HACKERS] Extra functionality to createuser

2013-12-07 Thread Amit Kapila
On Fri, Dec 6, 2013 at 10:31 AM, Peter Eisentraut pete...@gmx.net wrote: On Wed, 2013-11-20 at 11:23 -0500, Christopher Browne wrote: I note that similar (with not quite identical behaviour) issues apply to the user name. Perhaps the resolution to this is to leave quoting issues to the

Re: [HACKERS] Extra functionality to createuser

2013-12-05 Thread Peter Eisentraut
On Wed, 2013-11-20 at 11:23 -0500, Christopher Browne wrote: I note that similar (with not quite identical behaviour) issues apply to the user name. Perhaps the resolution to this is to leave quoting issues to the administrator. That simplifies the problem away. How about only one role name

Re: [HACKERS] Extra functionality to createuser

2013-11-20 Thread Christopher Browne
On Tue, Nov 19, 2013 at 11:54 PM, Amit Kapila amit.kapil...@gmail.com wrote: On further tests, I found inconsistency in behavior when some special characters are used in role names. 1. Test for role name containing quotes a. In psql, create a role containing quotes in role name.

Re: [HACKERS] Extra functionality to createuser

2013-11-20 Thread Christopher Browne
Wait, that doesn't work if more than one role is added, as they get merged together by the quoting. A somewhat ugly amount of quoting can be done at the shell level to induce double quotes. $ createuser -g \test_rol'e_3\ usequoted3 I note that similar (with not quite identical behaviour) issues

Re: [HACKERS] Extra functionality to createuser

2013-11-20 Thread Amit Kapila
On Wed, Nov 20, 2013 at 9:53 PM, Christopher Browne cbbro...@gmail.com wrote: Wait, that doesn't work if more than one role is added, as they get merged together by the quoting. A somewhat ugly amount of quoting can be done at the shell level to induce double quotes. $ createuser -g

Re: [HACKERS] Extra functionality to createuser

2013-11-19 Thread Christopher Browne
On Mon, Nov 18, 2013 at 1:01 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Sat, Nov 16, 2013 at 4:57 AM, Christopher Browne cbbro...@gmail.com wrote: Few comments: 1. + termoption-g//term + termoption--roles//term All other options which require argument are of form:

Re: [HACKERS] Extra functionality to createuser

2013-11-19 Thread Peter Eisentraut
Patch needs to be rebased again. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Extra functionality to createuser

2013-11-19 Thread Amit Kapila
On Wed, Nov 20, 2013 at 2:05 AM, Christopher Browne cbbro...@gmail.com wrote: On Mon, Nov 18, 2013 at 1:01 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Sat, Nov 16, 2013 at 4:57 AM, Christopher Browne cbbro...@gmail.com wrote: I picked the location of the 'g:' in the opt_long() call

Re: [HACKERS] Extra functionality to createuser

2013-11-17 Thread Amit Kapila
On Sat, Nov 16, 2013 at 4:57 AM, Christopher Browne cbbro...@gmail.com wrote: On Fri, Nov 15, 2013 at 3:14 PM, Peter Eisentraut pete...@gmx.net wrote: On 11/14/13, 4:35 PM, Christopher Browne wrote: On Thu, Nov 14, 2013 at 5:41 AM, Sameer Thakur samthaku...@gmail.com wrote: So i think -g

Re: [HACKERS] Extra functionality to createuser

2013-11-15 Thread Peter Eisentraut
On 11/14/13, 4:35 PM, Christopher Browne wrote: On Thu, Nov 14, 2013 at 5:41 AM, Sameer Thakur samthaku...@gmail.com wrote: So i think -g option is failing Right you are. I was missing a g: in the getopt_long() call. Attached is a revised patch that handles that.

Re: [HACKERS] Extra functionality to createuser

2013-11-15 Thread Christopher Browne
On Fri, Nov 15, 2013 at 3:14 PM, Peter Eisentraut pete...@gmx.net wrote: On 11/14/13, 4:35 PM, Christopher Browne wrote: On Thu, Nov 14, 2013 at 5:41 AM, Sameer Thakur samthaku...@gmail.com wrote: So i think -g option is failing Right you are. I was missing a g: in the getopt_long() call.

Re: [HACKERS] Extra functionality to createuser

2013-11-14 Thread Sameer Thakur
Hello, Tried to test this patch. Did the following 1. cloned from https://github.com/samthakur74/postgres 2. Applied patch and make install 3. created rolesapp_readonly_role,app2_writer_role 4. Tried createuser -D -S -l -g app_readonly_role,app2_writer_role test_user got error: createuser: invalid

Re: [HACKERS] Extra functionality to createuser

2013-11-14 Thread Sameer Thakur
1. cloned from https://github.com/samthakur74/postgres Sorry. cloned from https://github.com/postgres/postgres regards Sameer -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Extra functionality to createuser

2013-11-14 Thread Christopher Browne
On Thu, Nov 14, 2013 at 5:41 AM, Sameer Thakur samthaku...@gmail.com wrote: So i think -g option is failing Right you are. I was missing a g: in the getopt_long() call. Attached is a revised patch that handles that. And it behaves better: postgres@cbbrowne ~/p/s/b/scripts ./createuser -g

Re: [HACKERS] Extra functionality to createuser

2013-09-27 Thread Robert Haas
On Thu, Sep 26, 2013 at 1:04 PM, Christopher Browne cbbro...@gmail.com wrote: Sitting on my todo list for a while has been to consider the idea of adding a bit of additional functionality to createuser. One of the functions of CREATE ROLE is to associate the role with other roles, thus...

Re: [HACKERS] Extra functionality to createuser

2013-09-27 Thread Jim Nasby
On 9/27/13 6:01 AM, Robert Haas wrote: Thus, the above commands might be replaced by: PGUSER=postgres createuser -D -S -l -g app_readonly_role,app2_writer_role my_new_user Would this be worth adding to the ToDo list? I'd be inclined to favor a patch implementing this. +1 -- Jim C. Nasby,

Re: [HACKERS] Extra functionality to createuser

2013-09-27 Thread Christopher Browne
Attached is a patch implementing the -g / --roles option for createuser. I'll be attaching it to the open CommitFest shortly. createuser.diff Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: