Hprc banner tamu.png

Difference between revisions of "SW:PostgreSQL"

From TAMU HPRC
Jump to: navigation, search
(PostgreSQL)
(PostgreSQL on Ada)
Line 25: Line 25:
 
         the port by -p. the -D option specified where is the database file. The -l
 
         the port by -p. the -D option specified where is the database file. The -l
 
         option specify the log file for the database instance.
 
         option specify the log file for the database instance.
  (4) createdb yang -D /scratch/user/yangliu/Test/postresql/test.db -p 9999
+
  (4) createdb yang -p 9999
 
  (5) psql -d yang -p 999
 
  (5) psql -d yang -p 999
 
  (6) execute your sql statments in psql
 
  (6) execute your sql statments in psql

Revision as of 07:54, 29 March 2018

PostgreSQL

Description

PostgreSQL is a powerful, open source object-relational database system.

Access

PostgreSQL is open to all HPRC users.

PostgreSQL Module

TAMU HPRC currently supports the user of PostgreSQL though the PostgreSQL modules. There are several PostgreSQL modules available on Ada and Terra.


You can learn more about the module system on our SW:Modules page.


PostgreSQL on Ada

1) module load PostgreSQL/9.6.1-GCCcore-6.3.0-Python-2.7.12-bare
(2) initdb -D /scratch/user/yangliu/Test/postresql/test.db
(3) pg_ctl -o "-p 9999" -D /scratch/user/yangliu/Test/postresql/test.db -l
       /scratch/user/yangliu/Test/postresql/test.log start
       #comment: the -o provides extra options. In this example, the extra option is
       the port by -p. the -D option specified where is the database file. The -l
       option specify the log file for the database instance.
(4) createdb yang -p 9999
(5) psql -d yang -p 999
(6) execute your sql statments in psql
(7) pg_ctl -D /scratch/user/yangliu/Test/postresql/test.db stop

You may set password for your database if it is needed. This is the commands for the first time set up of postgres. After this, you only need to startup the server, connect to it, and stop it. You only need to initdb, createdb for one time. Let us know If you have further questions.