Skip to content

Instantly share code, notes, and snippets.

View sebastiaojuniordev's full-sized avatar

Sebastião Junior sebastiaojuniordev

View GitHub Profile
@sebastiaojuniordev
sebastiaojuniordev / export-postgresql-table.sh
Created March 10, 2022 16:48 — forked from stefanthoss/export-postgresql-table.sh
Linux command to export a PostgreSQL table from a remote server to a local CSV file.
psql -h hostname -U username -W -d database -t -A -F "," -c "SELECT * FROM table" > file.csv
# Explanation of the used options:
# -h Specifies the host name of the machine on which the server is running.
# -U Connect to the database as a specific user.
# -W Force psql to prompt for a password before connecting to a database.
# -d Specifies the name of the database to connect to.
# -t Turn off printing of column names and result row count footers, etc.
# -A Switches to unaligned output mode.
# -F Use separator as the field separator for unaligned output.
@sebastiaojuniordev
sebastiaojuniordev / estados-cidades.json
Created August 3, 2021 22:52 — forked from letanure/estados-cidades.json
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",