Hi Matthew,<div><br></div><div>I solved it! :)</div><div>Thank you for pointing out the obvious, I had issues with port. Even though I noticed zeroed out port I paid no attention to it because I assumed syslog-ng used default Postgres port. Postgres is listening to port 5432 (default), but syslog-ng was sending packets to port 0 (again, thanks for Wireshark idea). So I just pointed syslog-ng to the correct port and it started to work.</div>
<div><br></div><div>I must also say that I am positively surprised by really fast response :)</div><div><br></div><div>Best regards,</div><div>Janez Barbic</div><div><br><div class="gmail_quote">On Wed, Jan 5, 2011 at 10:31 PM, Matthew Hall <span dir="ltr">&lt;<a href="mailto:mhall@mhcomputing.net">mhall@mhcomputing.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Wed, Jan 05, 2011 at 10:24:17PM +0100, Janez Barbič wrote:<br>
&gt; Hi,<br>
&gt; I am a student of Computer Science at University of Ljubljana. Recently I<br>
&gt; started working on some project which includes logging into PostgreSQL<br>
&gt; database.<br>
<br>
</div>Welcome to the list.<br>
<div class="im"><br>
&gt; This is the error I get, logged by syslog-ng:<br>
&gt; *Jan  5 22:00:38 computerName syslog-ng[11080]: Error establishing SQL<br>
&gt; connection; type=&#39;pgsql&#39;, host=&#39;localhost&#39;, port=&#39;&#39;, username=&#39;eneraptor&#39;,<br>
&gt; database=&#39;eneraptordb&#39;, error=&#39;could not connect to server: Connection<br>
&gt; refused\x0a\x09Is the server running on host &quot;localhost&quot; and<br>
&gt; accepting\x0a\x09TCP/IP connections on port 0?\x0a&#39;<br>
<br>
</div>Are you setting the port right? Here it seems to be zeroed out, which is<br>
probably bad, there have also been some bugs in syslog-ng and libdbi<br>
which led to zeroed out or ignored port values before. Try using tcpdump<br>
or Wireshark or tshark on the lo interface to monitor the connection<br>
attempt to see if something looks wrong there. You can compare with what<br>
happens on a successful connect from the CLI client to spot the<br>
difference.<br>
<div class="im"><br>
&gt; Database has also been created, properly named and has the right user.<br>
<br>
</div>What happens when you try to query and add values to the table with the<br>
CLI client?<br>
<div class="im"><br>
&gt; From what I could gather is that syslog-ng probably can&#39;t connect to<br>
&gt; database, but I am running out of options on how to resolve this issue. I<br>
&gt; would be very grateful if you could help me resolve this issue.<br>
<br>
</div>We can probably help you figure it out but you&#39;ll have to do some<br>
debugging work as well to figure out the specifics.<br>
<br>
&gt; Best regards,<br>
&gt; Janez Barbic<br>
<br>
Good Luck,<br>
<font color="#888888">Matthew Hall.<br>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.campin.net/syslog-ng/faq.html" target="_blank">http://www.campin.net/syslog-ng/faq.html</a><br>
<br>
</font></blockquote></div><br></div>