PostgreSQL

WebHome | UnixGeekTools | Geekfarm | About This Site

Pointers

Startup/shutdown

First startup

Database startup

Database shutdown

psql

Upgrade

step 1 - back up data

step 2 - sofware install

step 3 - restore old data

JDBC

Database access

Creating a new database

Connecting to the database

Create a new table

CREATE TABLE tablename (
                        columnname1   VARCHAR(16) NOT NULL,
                        columnname2   INTEGER,
                        columnname3   TIME NOT NULL,
                        columnname4   FLOAT,
                        PRIMARY KEY ( columnname1, columname2 )
);

Inserting data

    INSERT INTO testtable VALUES ( 'c', '3' );

Querying data

    select * from testtable;

Viewing table information

    \dt testtable

drop all databases and start all over

    pg_ctl stop
    rm -rf /sw/var/postgresql/data/*
    /usr/local/pgsql/bin/initdb -D /sw/var/postgresql/data

Environment




Updated Sun Jul 23, 2006 12:13 PM