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"><<a href="mailto:mhall@mhcomputing.net">mhall@mhcomputing.net</a>></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>
> Hi,<br>
> I am a student of Computer Science at University of Ljubljana. Recently I<br>
> started working on some project which includes logging into PostgreSQL<br>
> database.<br>
<br>
</div>Welcome to the list.<br>
<div class="im"><br>
> This is the error I get, logged by syslog-ng:<br>
> *Jan 5 22:00:38 computerName syslog-ng[11080]: Error establishing SQL<br>
> connection; type='pgsql', host='localhost', port='', username='eneraptor',<br>
> database='eneraptordb', error='could not connect to server: Connection<br>
> refused\x0a\x09Is the server running on host "localhost" and<br>
> accepting\x0a\x09TCP/IP connections on port 0?\x0a'<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>
> 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>
> From what I could gather is that syslog-ng probably can't connect to<br>
> database, but I am running out of options on how to resolve this issue. I<br>
> 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'll have to do some<br>
debugging work as well to figure out the specifics.<br>
<br>
> Best regards,<br>
> 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>