Popular recipes tagged "postgres" but not "database"http://code.activestate.com/recipes/tags/postgres-database/2011-11-30T13:43:28-08:00ActiveState Code RecipesMinimalistic PostgreSQL console shell (Python)
2011-11-30T13:43:28-08:00ccpizzahttp://code.activestate.com/recipes/users/4170754/http://code.activestate.com/recipes/577468-minimalistic-postgresql-console-shell/
<p style="color: grey">
Python
recipe 577468
by <a href="/recipes/users/4170754/">ccpizza</a>
(<a href="/recipes/tags/postgres/">postgres</a>, <a href="/recipes/tags/postgresql/">postgresql</a>, <a href="/recipes/tags/sql/">sql</a>).
Revision 17.
</p>
<p>Primitive shell for running PostgreSQL quieries from console. Make sure you set the right connection settings in the script.</p>
<p>All queries are executed in autocommit mode.</p>
<p>Example command line usage:</p>
<pre class="prettyprint"><code>pg.py select * from mytable where oidh=1
</code></pre>
<p>The script recognizes a number of magic keywords:</p>
<pre class="prettyprint"><code>pg.py show databases
pg.py show schemas
pg.py describe <table_name>
</code></pre>