Difference between revisions of "PostgreSQL"

(CREATEDB)
(CREATEDB)
Line 27: Line 27:
  
 
<pre>
 
<pre>
createdb -h 127.0.0.1 -U elugy -W -o elugy testdb
+
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

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:

  • \l vagy \list: adatbázisok listázása
  • \q vagy \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