<!--#include virtual="/ssi/header.shtml" -->
      <h1>PostgreSQL</h1>
      <div id="main">
         <p>
           My PostgreSQL notes, both troubleshooting and SQL
           commands. 
         </p>
         <h2>Alter table</h2>
         <p>
           Adding fields to a table. Also see
           <a href="http://www.postgresql.org/docs/8.0/interactive/sql-altertable.html">
             the PostgreSQL manual (alter table)
           </a>
         </p>
<pre class="code">
  alter table eventInstance
    add externalId varchar
    add scheduleId varchar;
</pre>
         <h2>Running a script</h2>
         <p>
           Often, you want to write an sql script that creates the
           entire schema etc, this can be easily done with:
         </p>
<pre class="code">
  psql -U myuser -d mydatabase < myscript.sql
</pre>
      </div>
<!--#include virtual="/ssi/footer.shtml" -->

