<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>query | /var/logs/paulooi.log</title>
	<atom:link href="https://logs.paulooi.com/tag/query/feed" rel="self" type="application/rss+xml" />
	<link>https://logs.paulooi.com</link>
	<description>Systems Admin, Web Development and etc</description>
	<lastBuildDate>Tue, 25 Jan 2011 08:37:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>PostgreSQL Database psql Command Line Query</title>
		<link>https://logs.paulooi.com/postgresql-database-psql-command-line-query.php</link>
					<comments>https://logs.paulooi.com/postgresql-database-psql-command-line-query.php#comments</comments>
		
		<dc:creator><![CDATA[Paul Ooi]]></dc:creator>
		<pubDate>Sun, 11 Jul 2010 19:34:31 +0000</pubDate>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[pgsql]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[psql]]></category>
		<category><![CDATA[query]]></category>
		<guid isPermaLink="false">http://systems.takizo.com/?p=1024</guid>

					<description><![CDATA[<p>Sometime psql command line query can be useful when it comes to Bash script processing. There are data stored in PostgreSQL database and I would like to write a bash script to massage the data into report. Example below show...</p>
The post <a href="https://logs.paulooi.com/postgresql-database-psql-command-line-query.php">PostgreSQL Database psql Command Line Query</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></description>
										<content:encoded><![CDATA[<p>Sometime psql command line query can be useful when it comes to Bash script processing. There are data stored in PostgreSQL database and I would like to write a bash script to massage the data into report. Example below show query to PostgreSQL database by using the psql command.</p>
<pre>
<code>
/usr/local/bin/psql -c "SELECT email_address FROM members WHERE active is TRUE;" -U someuser -t -A -o member-email-address.txt accounting
</code>
</pre>
<p>psql is connecting to accounting database, query from members table and out the result into a txt file name member-email-address.txt. </p>
<p>-t &#8211; Return result only, do not result with table name.<br />
-A &#8211; By default, returned result will have white space, this is to remove the white space.<br />
-o &#8211; Output the result into a file. </p>The post <a href="https://logs.paulooi.com/postgresql-database-psql-command-line-query.php">PostgreSQL Database psql Command Line Query</a> first appeared on <a href="https://logs.paulooi.com">/var/logs/paulooi.log</a>.]]></content:encoded>
					
					<wfw:commentRss>https://logs.paulooi.com/postgresql-database-psql-command-line-query.php/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
