background preloader

Installation

Facebook Twitter

Installation PostgreSQL (Page 1) / Serveurs. Bonjour a tous, je viens demandé votre aide car la, je sèche un peut Je suis en train de scripté l'installation de postgresql ,malheureusement mon script de fonctionne pas. Le problème est que je dois utilisé l'utilisateur postgres pour exécuter une commande (voir code ci dessous).Le soucis est que je change bien d'utilisateur, mais le script ce bloque, Il n'exécute pas la commande situé juste après.

Donc avez vous une idée pour que je puisse faire ceci dans un script ? # Création de l'utilisateur et du groupe postgres groupadd postgres useradd -g postgres postgres # Creation du dossier qui va contenir les bases de donnees mkdir /usr/local/pgsql/data # Don du dossier a l'utilisateur fraichement cree chown postgres:postgres /usr/local/pgsql/data # Utilisation de l'utilisateur postgres -- a partir d'ici su postgres # Creation des bases de donnees /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data # Retour a l'utilisateur root exit Je vous remercie d'avance pour votre aide EDIT: j'ai trouvé, PostgreSQL 8.4: Creating a Database. The first test to see whether you can access the database server is to try to create a database. A running PostgreSQL server can manage many databases. Typically, a separate database is used for each project or for each user.

Possibly, your site administrator has already created a database for your use. He should have told you what the name of your database is. In that case you can omit this step and skip ahead to the next section. To create a new database, in this example named mydb, you use the following command: $ createdb mydb If this produces no response then this step was successful and you can skip over the remainder of this section. If you see a message similar to: createdb: command not found then PostgreSQL was not installed properly. . $ /usr/local/pgsql/bin/createdb mydb The path at your site might be different. Another response could be this: This means that the server was not started, or it was not started where createdb expected it. Where your own login name is mentioned. . $ createdb. Howto: Debian / Ubuntu Linux Install PostgreSQL Database Server. Q. How do I install PostgreSQL server under Ubuntu Linux?

A. PostgreSQL is an Open Source Software object relational database management system. POSTGRES pioneered many of the object-relational concepts now becoming available in some commercial databases. Traditional relational database management systems (RDBMS) support a data model consisting of a collection of named relations, containing attributes of a specific type. Task: Install PostgreSQL The best way to install PostgreSQL under Debian or Ubuntu Linux is to use apt-get command # apt-get install postgresql OR $ sudo apt-get install postgresql Output: Reading package lists...

Task: Connect to PostgreSQL server You can login as PostgreSQL superuser, enter command: $ su - postgres Now connect to default database called template1: $ psql template1 Output: postgres@debian:~$ psql template1 Welcome to psql 7.4.16, the PostgreSQL interactive terminal. Type \l to list database Type \q to quit See also:

PostgreSQL DEB Installation - OpenSCG Wiki. PostgreSQL command line psql, SQL tricks, pg_hba.conf configuration.