mirror of
https://github.com/cheat/cheat.git
synced 2025-07-06 13:51:56 +02:00
+html output
This commit is contained in:
@ -11,11 +11,16 @@ psql -U postgres -h serverAddress -d dbName
|
||||
psql -U postgres -h serverAddress --list
|
||||
|
||||
# Execute sql query and save output to file:
|
||||
#Add -t to get only rows as result.
|
||||
psql -U postgres -d dbName -c 'select * from tableName;' -o 'fileName'
|
||||
psql -U postgres -d dbName -c 'select * from tableName;' -o fileName
|
||||
|
||||
Read commands from file:
|
||||
# Execute query and get tabular html output:
|
||||
psql -U postgres -d dbName -H -c 'select * from tableName;'
|
||||
|
||||
# Execute query and save resulting rows to csv file:
|
||||
psql -U postgres -d dbName -t -A -P fieldsep=',' -c 'select * from tableName;' -o fileName.csv
|
||||
|
||||
# Read commands from file:
|
||||
psql -f fileName
|
||||
|
||||
# Restore databases from file:
|
||||
psql -f /fileName.backup postgres
|
||||
psql -f fileName.backup postgres
|
||||
|
Reference in New Issue
Block a user