Re: Create user or role from inside a function? - Mailing list pgsql-general

From Dan
Subject Re: Create user or role from inside a function?
Date
Msg-id 56561.203.143.226.132.1157111626.squirrel@secure.x32i.net
Whole thread Raw
In response to Re: Create user or role from inside a function?  (Roman Neuhauser <neuhauser@sigpipe.cz>)
List pgsql-general
(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 was also handy for this.

Thanks again!

Regards,

Dan


>     Double quotes can be used only for identifiers (table, column
>     names, etc), you want to use single quotes for strings. Now, since
>     you already are in a string (the function body), you need to escape
>     the single quotes inside. In SQL this is done by doubling the quote
>     character, IOW, by putting another single quote just before it:

pgsql-general by date:

Previous
From: "Dan"
Date:
Subject: Re: Create user or role from inside a function?
Next
From: Marc Evans
Date:
Subject: Re: postgres array quoting