########################################################################### # PostgreSQL Notes # # Anuradha Weeraman, 25 February 2000 # # $Id: postgresql.txt,v 1.1 2004/06/02 21:17:54 anuradha Exp $ # ########################################################################### This is what i have got from reading /usr/doc/postgresql-doc/indexpage.html as far as i see, pgsql looks to be a really stable rdbms very much similar to MySQL but a bit more resource hungry but much more reliable. * to start the pgsql server, one has to start the postmaster, which can be done on debian by '/etc/init.d/postgresql start' * psql is the client that can be used to query the db psql [-d dbname] [-h host] [-f filename] [-l] [-o filename] [-p port] [-q] [-s] [-u] [-x] -f : can be used to specify file to get sql input from -l : used to display the databases, must be used with -u -o : to sent output to a file -q : quiet mode, good for shell scripts -s : single-step-mode -u : prompt for username and password -x : turn on extended row format some psql commands are : \connect dbname username \copy table {FROM | TO} filename \d [table] - list tables in database or if table is specified, list the fields of the table \da - list aggregates \dd - list the description of the table, table.column, type, operator or aggregate. \df - list functions \di - list only indexes \do - list only operators \ds - list only sequences \dS - list system tables and indexes \dt - list only tables \dT - list types \e [filename] - edit the current query buffer or file \E [filename] - edit the current query buffer or file and execute it upon editor exit \f [separator] - set the field separator, default=space \g [|command] [filename] - send the current query input buffer to the backend and optionally save the output in filename or pipe the output into |command. \h [command] - give syntax help \H - toggle HTML3 output \i [filename] - read queries from filename into query input buffer \l - list all databases in the server \m - toggle old monitor-like table display \o [|command] [filename] - send query results to filename or pipe into command. default=stdout \p - print the current query buffer \q - quit the psql program \r - reset/clear the query buffer \s [filename] - save commandline histor to filename \t - toggle display of output column name headings and row count (default=on) \T - set HTML3.0