Thread: Can i see server SQL commands ?

Can i see server SQL commands ?

From
"Adnan DURSUN"
Date:
        Hi all

        I wanna know what is going on while a DML command works. For example
;
        Which commands are executed by the core when we send an "UPDATE tab
 SET col = val1..."
        in case there is a foreing key or an unique constraint on table
 "tab".

        How can i see that ?

        Best regards

 Adnan DURSUN
 ASRIN Bilişim Ltd.


Re: Can i see server SQL commands ?

From
"Jim C. Nasby"
Date:
On Thu, Sep 28, 2006 at 01:27:24PM +0300, Adnan DURSUN wrote:
>        Hi all
>
>        I wanna know what is going on while a DML command works. For example
> ;
>        Which commands are executed by the core when we send an "UPDATE tab
> SET col = val1..."
>        in case there is a foreing key or an unique constraint on table
> "tab".
>
>        How can i see that ?

Didn't someone just ask this yesterday?

I believe you can get that info by increasing client_min_messages.
What you specifically have to set it to I don't know; my guess would be
log or debug1.
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

Re: Can i see server SQL commands ?

From
"Adnan DURSUN"
Date:
----- Original Message -----
From: "Jim C. Nasby" <jim@nasby.net>

> Didn't someone just ask this yesterday?

    Yes. i did it :-)

> I believe you can get that info by increasing client_min_messages.
> What you specifically have to set it to I don't know; my guess would be
> log or debug1.

    I set it that but none of them effect the result :-( I think, answer to
this question is no !
Things that i want to see is what SQL commands run by backend while ;

    * Inserting a row (how checks FKs)
    * Updating row (how checks FKs and unique constrains)
    * deleting row (how checks FKs)

Best Regards
Adnan DURSUN




Re: Can i see server SQL commands ?

From
Shane Ambler
Date:
On 29/9/2006 11:47, "Adnan DURSUN" <a_dursun@hotmail.com> wrote:

> ----- Original Message -----
> From: "Jim C. Nasby" <jim@nasby.net>
>
>> Didn't someone just ask this yesterday?
>
>   Yes. i did it :-)
>
>> I believe you can get that info by increasing client_min_messages.
>> What you specifically have to set it to I don't know; my guess would be
>> log or debug1.
>
>   I set it that but none of them effect the result :-( I think, answer to
> this question is no !
> Things that i want to see is what SQL commands run by backend while ;
>
>   * Inserting a row (how checks FKs)
>   * Updating row (how checks FKs and unique constrains)
>   * deleting row (how checks FKs)
>
> Best Regards
> Adnan DURSUN
>
Is using EXPLAIN  not sufficient for your needs?

I haven't tried to find this info in the log myself, but -

client_min_messages and log_min_messages determine when to log, you aren't
interested in standard usage log info so you would want to try debug1
through to debug5 and see which gives you the detail you want.

The main settings you will want would be
debug_print_parse = on
debug_print_plan = on

This should give you the parser and planner info which you are after.


These may also help
debug_print_rewritten = on
debug_pretty_print = on
log_statement = all


--

Shane Ambler
Postgres@007Marketing.com

Get Sheeky @ http://Sheeky.Biz