Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Dan
(Sending to the list as I accidently only replied to Roman with my earlier reply) Thanks for your assistance. This was a case of user error. To me the examples I looked at used the double quote (") but on further inspection they do indeed use double single quotes ('). The quote_literal function w

Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Dan
thanks! I actually came to a similar solution after Roman's post. Thanks all for the replies! > Dan <[EMAIL PROTECTED]> schrieb: > >> Hey, >> >> I am running PostgreSQL 8.1.4 and I want to create a user from inside a >> function. Is this possible in 8.1? >> >> Ive found quite a few references o

Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Andreas Kretschmer
Dan <[EMAIL PROTECTED]> schrieb: > Hey, > > I am running PostgreSQL 8.1.4 and I want to create a user from inside a > function. Is this possible in 8.1? > > Ive found quite a few references on google using EXECUTE, but this seems > relevant to earlier versions, not 8.1. > > I have a function li

Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Karsten Hilbert
On Fri, Sep 01, 2006 at 08:13:14PM +1000, Dan wrote: > I am running PostgreSQL 8.1.4 and I want to create a user from inside a > function. Is this possible in 8.1? ... > I have a function like this: ... > Executing this function yields: > > # SELECT user_create('bob',1234,'bobspassword'); > ERROR

Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Martijn van Oosterhout
On Fri, Sep 01, 2006 at 08:13:14PM +1000, Dan wrote: > Hey, > > I am running PostgreSQL 8.1.4 and I want to create a user from inside a > function. Is this possible in 8.1? > > Ive found quite a few references on google using EXECUTE, but this seems > relevant to earlier versions, not 8.1. Does

Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-09-01 20:13:14 +1000: > Hey, > > I am running PostgreSQL 8.1.4 and I want to create a user from inside a > function. Is this possible in 8.1? > > Ive found quite a few references on google using EXECUTE, but this seems > relevant to earlier versions, not 8.1. > > I hav

[GENERAL] Create user or role from inside a function?

2006-09-01 Thread Dan
Hey, I am running PostgreSQL 8.1.4 and I want to create a user from inside a function. Is this possible in 8.1? Ive found quite a few references on google using EXECUTE, but this seems relevant to earlier versions, not 8.1. I have a function like this: CREATE FUNCTION user_create (un varchar, u