Score:0

Unable to create PostgreSQL user over TLS using createuser

us flag

I need to create a new PostgreSQL user on a remote PostgreSQL 13 server from on an Ubuntu 18.04 machine. createuser and psql (postgresql-client) are on the Ubuntu server. I was hoping I could use createuser to create the user like this:

createuser -SDRP -U pgadmin -h myserver.myurl.com -p 5433 -d defaultdb

Normally when connecting to my server I use:

psql -U pgadmin -h myserver.myurl.com -p 5433 -d defaultdb sslmode=require

I don't see any option to specify that TLS is required with createuser - am I missing it? I'm unable to use it without TLS for the connection.

Thanks in advance!

us flag
you can't use both -D and -d with creatuser
Score:2
us flag

libpq allows you to use a connection string in place of the database name. so, with libpq based tools, anywhere you can use a database name you can use a connection string.

 createuser "host=myserver.myurl.com port=5433 dbname=defaultdb sslmode=require user=pgadmin" -SDRP username_to_create
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.