Skip to content

Instantly share code, notes, and snippets.

@futuri
Last active October 15, 2024 16:02
Show Gist options
  • Save futuri/e2aa7f28a52116f62989b700af913814 to your computer and use it in GitHub Desktop.
Save futuri/e2aa7f28a52116f62989b700af913814 to your computer and use it in GitHub Desktop.
sudo -u postgres psql
postgres=# create database mydb;
postgres=# create user myuser with encrypted password 'mypass';
postgres=# grant all privileges on database mydb to myuser;
psql -c "ALTER USER usuario WITH PASSWORD 'nueva_password'"
#> en postgres ruby
apt install libpq-dev
gem install pg
#> en django python
pip install psycopg2-binary
# ------------------------------_
#Cuando se actualiza postgres y aparece este tipo de errores
```
WARNING: database "reviews_main3" has a collation version mismatch
DETAIL: The database was created using collation version 2.38, but the operating system provides version 2.39.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE reviews_main3 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
```
sudo -u postgres psql
\c reviews_main3
ALTER DATABASE reviews_main3 REFRESH COLLATION VERSION;
\q
@futuri
Copy link
Author

futuri commented Aug 20, 2023

CREATE USER heber SUPERUSER;
ALTER USER heber WITH PASSWORD 'heber';

@futuri
Copy link
Author

futuri commented Aug 20, 2023

ALTER USER tournament WITH PASSWORD 'dosber/2023';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment