Thread: Logging queries

Logging queries

From
Madison Kelly
Date:
Hi all,

   I've got a machine I am setting up (read; low volume atm). I need a
way to log all the queries made to Postgres (just for a short time).

   I've got a problem with a 3rd party program (OSS, but I'm not 'let'
enough to trace it) and I am hoping to help fix the problem by being
able to see what query it is exactly trying to do.

   I remember once long ago I did this but I'll be dumb-struck if I can
remember how.

   As an aside;

   I've got a user named 'madison' who is in postgres and owns another
database which is working fine with one of my programs. So I know the
user is okay. I've created a new database and I am trying to tell this
program to connect to the new database as this user (local machine) but
I keep getting the error:

2006-02-02 23:07:36 [21958] LOG:  connection received: host=127.0.0.1
port=33387
2006-02-02 23:07:36 [21958] FATAL:  IDENT authentication failed for user
"madison"
2

   I've tried changing the 'pg_hba.conf' file from 'ident sameuser' to
'trust'' with no love, too.

   I'm hoping that seeing the query this program is using might help me
solve this problem.

   Thanks!!

Madison

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
           Madison Kelly (Digimer)
    TLE-BU; The Linux Experience, Back Up
Main Project Page:  http://tle-bu.org
Community Forum:    http://forum.tle-bu.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Re: Logging queries

From
Madison Kelly
Date:
Madison Kelly wrote:
> Hi all,
>
>   I've got a machine I am setting up (read; low volume atm). I need a
> way to log all the queries made to Postgres (just for a short time).
>
>   I've got a problem with a 3rd party program (OSS, but I'm not 'let'
> enough to trace it) and I am hoping to help fix the problem by being
> able to see what query it is exactly trying to do.
>
>   I remember once long ago I did this but I'll be dumb-struck if I can
> remember how.
>
>   As an aside;
>
>   I've got a user named 'madison' who is in postgres and owns another
> database which is working fine with one of my programs. So I know the
> user is okay. I've created a new database and I am trying to tell this
> program to connect to the new database as this user (local machine) but
> I keep getting the error:
>
> 2006-02-02 23:07:36 [21958] LOG:  connection received: host=127.0.0.1
> port=33387
> 2006-02-02 23:07:36 [21958] FATAL:  IDENT authentication failed for user
> "madison"
> 2
>
>   I've tried changing the 'pg_hba.conf' file from 'ident sameuser' to
> 'trust'' with no love, too.
>
>   I'm hoping that seeing the query this program is using might help me
> solve this problem.
>
>   Thanks!!
>
> Madison
>

Oops, should have mentioned that I'm running 7.4.7 on Debian Sarge stable.

Madison

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
           Madison Kelly (Digimer)
    TLE-BU; The Linux Experience, Back Up
Main Project Page:  http://tle-bu.org
Community Forum:    http://forum.tle-bu.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Solved: Re: Logging queries

From
Madison Kelly
Date:
Madison Kelly wrote:
> Madison Kelly wrote:
>> Hi all,
>>
>>   I've got a machine I am setting up (read; low volume atm). I need a
>> way to log all the queries made to Postgres (just for a short time).
>>
>>   I've got a problem with a 3rd party program (OSS, but I'm not 'let'
>> enough to trace it) and I am hoping to help fix the problem by being
>> able to see what query it is exactly trying to do.
>>
>>   I remember once long ago I did this but I'll be dumb-struck if I can
>> remember how.
>>
>>   As an aside;
>>
>>   I've got a user named 'madison' who is in postgres and owns another
>> database which is working fine with one of my programs. So I know the
>> user is okay. I've created a new database and I am trying to tell this
>> program to connect to the new database as this user (local machine)
>> but I keep getting the error:
>>
>> 2006-02-02 23:07:36 [21958] LOG:  connection received: host=127.0.0.1
>> port=33387
>> 2006-02-02 23:07:36 [21958] FATAL:  IDENT authentication failed for
>> user "madison"
>> 2
>>
>>   I've tried changing the 'pg_hba.conf' file from 'ident sameuser' to
>> 'trust'' with no love, too.
>>
>>   I'm hoping that seeing the query this program is using might help me
>> solve this problem.
>>
>>   Thanks!!
>>
>> Madison
>>
>
> Oops, should have mentioned that I'm running 7.4.7 on Debian Sarge stable.
>
> Madison
>

For the love of... >.<

   I found the answer right after posting... Just had to set
'log_min_duration_statement' in 'postgres.conf' to '0'.

Sorry for the line noise! ^.^;

Madison

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
           Madison Kelly (Digimer)
    TLE-BU; The Linux Experience, Back Up
Main Project Page:  http://tle-bu.org
Community Forum:    http://forum.tle-bu.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-