Best ripping software windows 10. Install PostgreSQL 9 in Mac OSX via Homebrew Mac OS X Snow Leopard System Version: Mac OS X 10.6.5 Kernel Version: Darwin 10.5.0 Install notes for PostgreSQL 9.0.1 install using Homebrew: sh-3.2# brew install postgresql sh-3.2# brew install postgresql Warning: It appears you have MacPorts or Fink installed. Software installed with MacPorts and Fink are known to cause problems. ![]() ![]() To uninstall PostgreSQL on a Mac system, assume the identity of an operating system superuser, and navigate into the folder in which the uninstaller resides: Then, invoke the uninstaller with the command: If prompted, provide a password that allows the uninstaller to make changes to your system. Big boss 1300 watt oil less air fryer reviews. If you experience issues try uninstalling these tools. # install the binary $ brew install postgresql # init it $ initdb /usr/local/var/postgres # start the postgres server $ postgres -D /usr/local/var/postgres # create your database $ createdb mydb Then play around with it: Erics-MacBook:~ eric$ psql mydb psql (9.0.1) Type 'help' for help. Mydb=# create table users(id serial, name varchar(25)); NOTICE: CREATE TABLE will create implicit sequence 'users_id_seq' for serial column 'users.id' CREATE TABLE mydb=# insert into users(name) values('eric'); INSERT 0 1 mydb=# insert into users(name) values('lxneng'); INSERT 0 1 mydb=# select * from users; id| name ----+------------- 1| eric 2| lxneng mydb=# q. Also worth noting. Depending upon which versions of Postgresql you've had on your machine, sometimes you may need to clear out the old /usr/local/var/postgres folder. Running postgresql via launchtcl can sometimes fail silently if there is an old db folder from a different version. # remove old database files (this is dangerous) $rm -rf /usr/local/var/postgres # install the binary $ brew install postgresql # init it $ initdb /usr/local/var/postgres # start the postgres server $ postgres -D /usr/local/var/postgres # create your database $ createdb mydb. Wow, it had been a long time since I last started on my Mac computer (, to be specific), and it took almost almost 20 minutes to remember how to do it. So, to keep that from happening again, here's a quick tip on how to start Postgres (Postgresql) on a computer. Step 1: Log in as the postgres user A long time ago I followed this. After I finished that installation, a 'postgres' user account was created on my Mac during the installation process. So, Step 1 of starting Postgres is to open a Terminal window, and switch over to that user account, like this: su - postgres After issuing this command, you'll also need to provide the password for the 'postgres' user. Scanner driver for canon mx870. Step 2: Issue the startup command Once you're logged in as the postgres user, you just need to make sure your path includes the Postgres bin directory, and then issue the command to start Postgres. Here's how I include the Postgres bin directory in my path: export PATH=$PATH:/usr/local/pgsql/bin And here's the command I use to start the Postgres server: /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start (As you can see from these commands, the root directory of the Postgres server on my Mac computer is /usr/local/pgsql.) Bonus: How to create and connect to a Postgresql database As a quick bonus (and a reminder to myself), here's how you create and then use a Postgres database. First, the command to create a new Postgres database named test: createdb test Next, you can connect to this new test database with the following command: psql test Note that I'm doing all this without specifying the database user I want to connect as. Postgres is smart enough to see that I'm logged in as the postgres user, and it lets me right in. To demonstrate this, if I switch over to a different Terminal and try to log in from my normal 'al' user account, I get the following error message: prompt> psql test psql: FATAL: role 'al' does not exist.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |