PostgreSQL Commond Line Cheat Sheet _ Jason Meridth's Blog
-
Upload
james-howe -
Category
Documents
-
view
219 -
download
0
Transcript of PostgreSQL Commond Line Cheat Sheet _ Jason Meridth's Blog
-
8/10/2019 PostgreSQL Commond Line Cheat Sheet _ Jason Meridth's Blog
1/4
Jason Meridth's Blog (http://blog.jasonmeridth.com/)
PostgreSQL Commond Line Cheat SheetPosted: Oct 02, 2012 | More posts about postgresql (../../categories/postgresql.html) command line (../../categories/comm and-line.html) | Source (index.md)
change to postgres user and open psql prompt
sudo -u postgres psql postgres
list databases
postgres=# \l
list roles
postgres=# \du
create role
postgres=#CREATE ROLE demorole1 WITH LOGIN ENCRYPTED PASSWORD 'password1' CREATEDB;
alter role
postgres=#ALTER ROLE demorole1 CREATEROLE CREATEDB REPLICATION SUPERUSER;
drop role
postgres=#DROP ROLE demorole1; Share
http://blog.jasonmeridth.com/http://blog.jasonmeridth.com/posts/postgresql-command-line-cheat-sheet/index.mdhttp://blog.jasonmeridth.com/categories/command-line.htmlhttp://blog.jasonmeridth.com/categories/postgresql.htmlhttp://blog.jasonmeridth.com/ -
8/10/2019 PostgreSQL Commond Line Cheat Sheet _ Jason Meridth's Blog
2/4
Previous post (../testing-mail-from-the-command-line-on-ubuntu/) Next post (../bash-profile-vs-bashrc/)
create database
postgres=#CREATE DATABASE demodb1 WITH OWNER demorole1 ENCODING 'UTF8';
grant privileges to new user
GRANT ALL PRIVILEGES ON DATABASE demodb1 TO demorole1;
drop database
postgres=#DROP DATABASE demodb1;
connect to database
\c
list tables in connected database
\dt
list columns on table
\d
backup database
pg_dump >
9 Comments
http://blog.jasonmeridth.com/posts/bash-profile-vs-bashrc/http://blog.jasonmeridth.com/posts/testing-mail-from-the-command-line-on-ubuntu/ -
8/10/2019 PostgreSQL Commond Line Cheat Sheet _ Jason Meridth's Blog
3/4
pebre79
Thanks! This was really useful, it got me out of a pickle. :)
chipcastle Great stuff Jason!
lostcitizen
thanks!
Jimbo
Thank you very much!
John Scheianu
very practical, thanks!
dom
brief and up to the point. well done!
Sam
super useful.
Steven Chanin
Switching from MySQL to Postgres for new projects. This was helpful to quickly see the basic commands you use all the time!
http://disqus.com/disqus_MY7xpvvQE4/http://disqus.com/disqus_MY7xpvvQE4/http://disqus.com/chipcastle/http://disqus.com/pebre79/http://disqus.com/pebre79/http://disqus.com/steven_chanin/http://disqus.com/samalbanie/http://disqus.com/disqus_MY7xpvvQE4/http://disqus.com/chipcastle/http://disqus.com/pebre79/ -
8/10/2019 PostgreSQL Commond Line Cheat Sheet _ Jason Meridth's Blog
4/4
Gitosis and Gitweb Part 1
Lasse: sorry for the delayed response. Usually
when you see a password request, and you're not wanting it, it
means that your local ssh key is not in the
Agile coaching
Nice summary! I particularly like "Agile Coach
== thick skin" which we don't explicitly say in the book but is
something we've both found to be true.
Gitosis and Gitweb Part 2
doh!!thank you Leandro. Can't believe I
missed that. I'll edit the post tonight (giving you credit)
Git reset, checkout & "bare double dash", and revert
good job!:)
ash
awesome
Contents 2014 Jason Meridth (mailto:[email protected]) - Powered by Nikola (http://getnikola.com)
(http://creativecommons.org/licenses/by-nc-sa/2.5/ar/)
http://creativecommons.org/licenses/by-nc-sa/2.5/ar/http://getnikola.com/mailto:[email protected]://disqus.com/websites/?utm_source=jasonmeridth&utm_medium=Disqus-Footerhttp://disqus.com/http://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fgit-reset-checkout-bare-double-dash-revert%2F%3Aygf2urvhN2Zr6NVJtK_SXB9Akx0&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=78750105&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fgit-reset-checkout-bare-double-dash-revert%2F%3Aygf2urvhN2Zr6NVJtK_SXB9Akx0&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=78750105&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fgitosis-and-gitweb-part-2%2F%3A6ZFcZf_cKCbq738NN2Cq5uOTR_Y&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=100662889&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fgitosis-and-gitweb-part-2%2F%3A6ZFcZf_cKCbq738NN2Cq5uOTR_Y&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=100662889&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fagile-coaching-book-review%2F%3ALkOSgYtkogCf6OdpDPcth7ceWUI&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=51697419&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fagile-coaching-book-review%2F%3ALkOSgYtkogCf6OdpDPcth7ceWUI&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=51697419&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fgitosis-and-gitweb-part-1%2F%3A9h6kHuXX7NCRRGpvQnkloNdWrjc&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=100657944&zone=internal_discoveryhttp://redirect.disqus.com/url?url=http%3A%2F%2Fblog.jasonmeridth.com%2Fposts%2Fgitosis-and-gitweb-part-1%2F%3A9h6kHuXX7NCRRGpvQnkloNdWrjc&imp=7uf6mtd1t7sd3j&prev_imp&forum_id=204158&forum=jasonmeridth&thread_id=868586690&major_version=metadata&thread=100657944&zone=internal_discovery