Last active
May 30, 2025 23:12
-
-
Save emrahoruc/ecd76b541afd68d2443c2019a1445805 to your computer and use it in GitHub Desktop.
Postgresql Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Set Id Seq | |
| SELECT setval('tablename_id_seq', (SELECT MAX(id) FROM public.tablename)); | |
| -- Log in | |
| sudo -i -u postgres | |
| psql dbname username | |
| -- Backup | |
| sudo -u postgres pg_dump -U postgres -d mydb -F c -f /tmp/mydb.backup | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment