<?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>log_statement &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/log_statement/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Fri, 08 Dec 2017 04:31:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL: Log the DROP TABLE Statement</title>
		<link>https://www.dbrnd.com/2017/12/postgresql-log-the-drop-table-statement/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 30 Dec 2017 16:16:15 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[drop table]]></category>
		<category><![CDATA[log_line_prefix]]></category>
		<category><![CDATA[log_statement]]></category>
		<category><![CDATA[logging_collector]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6850</guid>

					<description><![CDATA[How to log the DROP TABLE Statement in the log file of PostgreSQL? Above is a common question/suggestion by the PostgreSQL DBA. We should log all the type of statements like DDL, DML. But DDL is most important than DML logging. For logging the DDL statement into log files, we should change the following parameters [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&amp;linkname=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&amp;linkname=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&amp;linkname=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&amp;linkname=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&amp;linkname=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&amp;linkname=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F12%2Fpostgresql-log-the-drop-table-statement%2F&#038;title=PostgreSQL%3A%20Log%20the%20DROP%20TABLE%20Statement" data-a2a-url="https://www.dbrnd.com/2017/12/postgresql-log-the-drop-table-statement/" data-a2a-title="PostgreSQL: Log the DROP TABLE Statement"></a></p><p><strong>How to log the DROP TABLE Statement in the log file of PostgreSQL?</strong></p>
<p>Above is a common question/suggestion by the PostgreSQL DBA. We should log all the type of statements like DDL, DML. But DDL is most important than DML logging. </p>
<p>For logging the DDL statement into log files, we should change the following parameters in the postgresql.conf file. </p>
<blockquote><p>log_statement=&#8217;ddl&#8217;<br />
log_line_prefix = ‘%t %c %u ‘ (time, sessionid, user)<br />
logging_collector = ON</p></blockquote>
<p><strong>For example:</strong><br />
I dropped a tbl_student table. Now, I can see below the line in my log file.</p>
<pre class="crayon-plain-tag">2017-12-08 16:23:12 CET LOG:  statement: DROP TABLE tbl_student;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Important Parameters to enable Log for all Queries</title>
		<link>https://www.dbrnd.com/2015/11/postgresql-important-parameters-to-enable-log-for-all-queries/</link>
					<comments>https://www.dbrnd.com/2015/11/postgresql-important-parameters-to-enable-log-for-all-queries/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 12 Nov 2015 16:08:24 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PostgreSQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[log_statement]]></category>
		<category><![CDATA[logging_collector]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[postgresql.conf]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=928</guid>

					<description><![CDATA[In this post, I am sharing an important topic for PostgreSQL Database Professional. A database log is necessary for finding different statuses, errors, bad queries and any changes on the Database Server. A Database Administrator can also log different executed queries and analyze those for performance tuning. Following are few relevant parameters for enabling the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&amp;linkname=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&amp;linkname=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&amp;linkname=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&amp;linkname=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&amp;linkname=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&amp;linkname=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fpostgresql-important-parameters-to-enable-log-for-all-queries%2F&#038;title=PostgreSQL%3A%20Important%20Parameters%20to%20enable%20Log%20for%20all%20Queries" data-a2a-url="https://www.dbrnd.com/2015/11/postgresql-important-parameters-to-enable-log-for-all-queries/" data-a2a-title="PostgreSQL: Important Parameters to enable Log for all Queries"></a></p><p>In this post, I am sharing an important topic for PostgreSQL Database Professional.</p>
<p>A database log is necessary for finding different statuses, errors, bad queries and any changes on the Database Server.<br />
A Database Administrator can also log different executed queries and analyze those for performance tuning. </p>
<p>Following are few relevant parameters for enabling the PostgreSQL log for all the queries.</p>
<p>Please open your <strong>postgresql.conf</strong> file and make sure about all logs related parameter&#8217;s value which are mentioned below.</p>
<ul>
<li><strong>log_directory</strong> = &#8216;pg_log&#8217; (default directory name)</li>
<li><strong>log_filename</strong> = &#8216;postgresql-%Y-%m-%d_%H%M%S.log&#8217; (default file name structure)</li>
<li><strong>log_statement</strong> = &#8216;all&#8217; (value &#8216;all&#8217; is recommended {none, ddl, mod, all})</li>
<li><strong>logging_collector</strong> = ON</li>
<li><strong>log_line_prefix</strong> = &#8216;%t %c %u &#8216; (time, sessionid, user)</li>
<li><strong>log_destination</strong> = ON (stderr,syslog,csvlog,eventlog)</li>
<li><strong>log_rotation_size</strong> = 15MB</li>
<li><strong>log_rotation_age</strong> = 1d (create new log file every day)</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/11/postgresql-important-parameters-to-enable-log-for-all-queries/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
