Difference between revisions of "PostgreSQL"
(→CREATEDB) |
(→CREATEDB) |
||
| Line 27: | Line 27: | ||
<pre> | <pre> | ||
| − | createdb -h 127.0.0.1 -U elugy -W - | + | createdb -h 127.0.0.1 -U elugy -W -O elugy testdb |
| + | createdb --host 127.0.0.1 --username elugy --password --owner elugy testdb | ||
</pre> | </pre> | ||
Revision as of 13:53, 29 October 2018
Contents
PSQL
Csatlakozás:
psql -h <HOST> -U <USERNAME> -w -d <DBNAME> psql -h 127.0.0.1 -U elugy -d elugy_portal
Parancs futtatása:
psql -h 127.0.0.1 -U elugy -d elugy_portal -c "select count(1) from parameter;"
SQL fájl futtatása, dump betöltés:
psql -h 127.0.0.1 -U elugy -W -d elugy_portal -f test.sql psql -h 127.0.0.1 -U elugy -W -d elugy_portal < test.sql
Csatlakozás utáni parancsok:
\lvagy\list: adatbázisok listázása\qvagy\quit: kilépés
CREATEDB
createdb -h 127.0.0.1 -U elugy -W -O elugy testdb createdb --host 127.0.0.1 --username elugy --password --owner elugy testdb