PostgreSQL

HomePage | RecentChanges | Preferences

Difference (from prior major revision) (author diff)

Added: 2a3
<pre>

Added: 17a19
</pre>

PostgreSQL

$ brew install postgres
==> Downloading https://homebrew.bintray.com/bottles/postgresql-10.3.high_sierra
######################################################################## 100.0%
==> Pouring postgresql-10.3.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/postgresql/10.3/bin/initdb /usr/local/var/postgres
==> Caveats
To migrate existing data from a previous major version of PostgreSQL run:
  brew postgresql-upgrade-database

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
==> Summary
🍺  /usr/local/Cellar/postgresql/10.3: 3,383 files, 39.2MB

====

 set PGDATA in ~/.bash_profile
 $ touch ~/logs/postgresql.txt
 $ pg_ctl initdb -l ~/logs/postgresql.txt
 $ pg_ctl -l ~/logs/postgresql.txt start

References

=====

Commands

\list
\connect [database_name]
\d
\d [table_name]
\d+ [table_name]

http://www.postgresql.org/docs/9.1/static/sql-altertable.html

DROP DATABASE whatever_dev;

http://www.postgresql.org/docs/8.2/static/sql-dropdatabase.html

select count(*) from transactions;

HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited April 7, 2018 11:39 am by 81-94-98-198.dsl.wavetel.us (diff)
Search: