<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>database on Akash Goswami</title>
    <link>https://akashgoswami.dev/tags/database/</link>
    <description>Recent content in database on Akash Goswami</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 26 Sep 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://akashgoswami.dev/tags/database/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to install Postgres on macOS</title>
      <link>https://akashgoswami.dev/notes/install-postgres-macos/</link>
      <pubDate>Thu, 26 Sep 2024 00:00:00 +0000</pubDate>
      
      <guid>https://akashgoswami.dev/notes/install-postgres-macos/</guid>
      <description>How I&amp;#39;ve setup and installed PostgreSQL on my Macbook</description>
      <content:encoded><![CDATA[<p>There are a few ways of setting up Postgres on MacOS.</p>
<p>This is what I found worked best for me:</p>
<ol>
<li>Install postgres via Homebrew - <code>brew install postgresql@16</code></li>
<li>Start Postgres server - <code>brew services start postgresql@16</code></li>
<li>Check service is running - <code>brew services list</code></li>
<li>Add PostgreSQL to PATH - <code>echo 'export PATH=&quot;/opt/homebrew/opt/postgresql/bin:$PATH&quot;' &gt;&gt; ~/.zshrc</code></li>
<li>Reload the shell - <code>source ~/.zshrc</code></li>
<li>Verify psql command - <code>psql --version</code></li>
<li>Add a postgres user - <code>createuser -s -r postgres</code></li>
<li>Connect to the default postgres database <code>psql -d postgres</code></li>
<li>Create a password for the postgres user - <code>ALTER USER  postgres  WITH PASSWORD ‘password’;</code> (replace password with your selected password)</li>
<li>Install pgAdmin</li>
<li>Open pgAdmin and connect to the local Postgres sever (enter password when asked)</li>
</ol>
<p>If anyone has a better way of doing this, please feel free to let me know. It took some trial and error to get this working for myself.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
