Re: postgres bash prompt error while user creation

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: " *EXTERN*" <Pingale(dot)amol(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres bash prompt error while user creation
Date: 2007-10-30 07:13:43
Message-ID: D960CB61B694CF459DCFB4B0128514C26ABA9C@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> i want to create a shell script in that i want to create postgresql
> user and database.both this task are created properly and executed
> properly but after user and DB creation i am there on ( -bash-3.00$ )
> and i wanna come back to [root(at)localhost:localdomain ~]# and my
> script is
> #!/bin/bash
> su -l postgres;
> psql -U postgres -c "CREATE USER admin27 WITH PASSWORD 'admin27'
> CREATEDB;" template1
> psql -U admin27 -c "CREATE DATABASE emcc27;" template1 \q exit;
> plzz help me to back to root from postgres bash prompt

You should probably start by reading about the basics of
shell programming. Apart from the obvious documentation
the man pages for "su" may help you to create something that
looks like a shell script.

You might consider the use of "here documents" as described
in the "bash" man page.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-10-30 07:18:08 Re: sql
Previous Message Albe Laurenz 2007-10-30 07:10:09 Re: nonstandard use of