<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Postgres on Lockwood Family Having Fun Writing Code</title><link>https://lockwood.fun/tags/postgres/</link><description>Recent content in Postgres on Lockwood Family Having Fun Writing Code</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 04 Dec 2019 00:47:57 -0700</lastBuildDate><atom:link href="https://lockwood.fun/tags/postgres/index.xml" rel="self" type="application/rss+xml"/><item><title>A Curious Moon | Week 3 | Makefile &amp; Normalize Data</title><link>https://lockwood.fun/post/postgres/a-curious-moon-week-3-make-normalize/</link><pubDate>Wed, 04 Dec 2019 00:47:57 -0700</pubDate><guid>https://lockwood.fun/post/postgres/a-curious-moon-week-3-make-normalize/</guid><description>&lt;h1 id="a-curious-moon--week-3--makefile--normalize-data"&gt;A Curious Moon | Week 3 | Makefile &amp;amp; Normalize Data&lt;/h1&gt;
&lt;h2 id="apologies-its-been-a-while"&gt;Apologies, it&amp;rsquo;s been a while&lt;/h2&gt;
&lt;p&gt;We are sorry, life hit us hard in November. I always forget how quickly holidays are upon us. This year April and Kaleb took a much deserved vacation and so they were out of town for a few weeks and so we opted to wait for them instead of charging on ahead of them. I think it was a wise decision. We don&amp;rsquo;t want anyone becoming so far behind that they feel they can&amp;rsquo;t catch up. The idea is to do this together so waiting made the most sense.&lt;/p&gt;</description></item><item><title>A Curious Moon | Week 2 | Master Plan</title><link>https://lockwood.fun/post/postgres/a-curious-moon-week-2-master-plan/</link><pubDate>Wed, 06 Nov 2019 00:01:23 -0700</pubDate><guid>https://lockwood.fun/post/postgres/a-curious-moon-week-2-master-plan/</guid><description>&lt;h1 id="a-curious-moon--week-2--master-plan"&gt;A Curious Moon | Week 2 | Master Plan&lt;/h1&gt;
&lt;h2 id="create-master-plan-table"&gt;Create Master Plan table&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-postgres" data-lang="postgres"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;create&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;table&lt;/span&gt; master_plan(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; the_date date,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; title varchar(&lt;span style="color:#ae81ff"&gt;100&lt;/span&gt;), 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; description text
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We have a table! Just as we were getting exciting we find out that we were supposed to add a primary key and also what if the table already exists? So in order to fix those things our new create table looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-postgres" data-lang="postgres"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;drop&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;table&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;exists&lt;/span&gt; master_plan;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;create&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;table&lt;/span&gt; master_plan(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; id serial &lt;span style="color:#66d9ef"&gt;primary&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;key&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; the_date date,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; title varchar(&lt;span style="color:#ae81ff"&gt;100&lt;/span&gt;), 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; description text
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;serial primary key&lt;/code&gt; is some postgres shortcode that will add a column of integer type that can&amp;rsquo;t be NULL and will auto increment.&lt;/p&gt;</description></item><item><title>A Curious Moon | Week 1 | Getting Setup</title><link>https://lockwood.fun/post/postgres/a-curious-moon-week-1-setup/</link><pubDate>Wed, 30 Oct 2019 23:12:30 -0600</pubDate><guid>https://lockwood.fun/post/postgres/a-curious-moon-week-1-setup/</guid><description>&lt;h1 id="a-curious-moon--week-1--getting-setup"&gt;A Curious Moon | Week 1 | Getting Setup&lt;/h1&gt;
&lt;p&gt;After completing our Python course, &lt;a href="https://www.udemy.com/share/100058A0cdcVZbR34=/"&gt;Complete Python Bootcamp: Go from zero to hero in Python 3 at Udemy&lt;/a&gt;, we decided the next thing we would like to learn more about would be databases. At work I&amp;rsquo;ve been participating in a course in PostgreSQL called &lt;a href="https://bigmachine.io/products/a-curious-moon/"&gt;A curious Moon&lt;/a&gt; and I suggested that to the group. They have agreed and so we have begun.&lt;/p&gt;
&lt;h2 id="setting-up-its-never-easy"&gt;Setting up; It&amp;rsquo;s never easy&lt;/h2&gt;
&lt;p&gt;We actually started a week or maybe 2 ago and ran into more issues that I care to cover trying to get April and Kaleb up and running on their Windows laptops. So many, in fact, that we decided instead that we would install Ubuntu on their laptops and dual-boot so that we could have them inside a Linux environment where I could better help them as issues come up. I, and my brother Austin, are both working on Mac OSX and so this will make a more consistent environment. One that I hope means any issues they come across I will have also and will therefore be able to assist them. (I&amp;rsquo;m still debating if I should install Ubuntu, I do have it on a VirtualBox VM if I absolutely need it&amp;hellip;).&lt;/p&gt;</description></item></channel></rss>