Prev | Current Page 1140 | Next

Michael McCallister

"openSUSE Linux Unleashed"


The psql client passes the system login information of the account and runs it to the
PostgreSQL server for authentication. Unfortunately this means that you must be logged
in as the postgres system account to access the postgres PostgreSQL administrator
account. The easiest way to do that is with the Linux su command:
linux:~ # su postgres
postgres@linux:/root> psql -U postgres
could not change directory to ???/root???
Welcome to psql 8.1.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#
CHAPTER 29 Managing Databases 602
Now you are logged in with the postgres database superuser account. Similar to the
MySQL show commands, PostgreSQL uses a series of special, non-SQL meta-commands to
view database information. The four most used meta-commands are:
. \l to list the databases
. \c to connect to a database
. \dt to list the tables within a database
. \q to exit the database
While logged in as the postgres superuser, you can create a new database for the
PostgreSQL server.


Pages:
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152
gry on line życzenia ślubne gustowne meble katowice felgi aluminiowe poznań katalog firm