Transactions

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Transactions

Karl Martin Skoldebrand

Hi,

 

Is there a way to track “transactions” by default (i.e. without anyone having set up anything specific). The problem I am facing is that users are claiming that settings are disappearing with them doing anything to affect them. It would be good to be able to see what postgresql thinks is going on.

*Subscriber adds Severity/BU/Service by ticking the corresponding box in subscriber configuration in WEBAPP. This works for some time.

*Subscriber stops receiving selected [tickets].

*Upon checking settings the selected Severity/BU/Service has been unselected.

 

/M.

 

============================================================================================================================

Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.

============================================================================================================================

Reply | Threaded
Open this post in threaded view
|

Sv: Transactions

Andreas Joseph Krogh-2
På tirsdag 09. april 2019 kl. 11:26:29, skrev Karl Martin Skoldebrand <[hidden email]>:

Hi,

 

Is there a way to track “transactions” by default (i.e. without anyone having set up anything specific). The problem I am facing is that users are claiming that settings are disappearing with them doing anything to affect them. It would be good to be able to see what postgresql thinks is going on.

*Subscriber adds Severity/BU/Service by ticking the corresponding box in subscriber configuration in WEBAPP. This works for some time.

*Subscriber stops receiving selected [tickets].

*Upon checking settings the selected Severity/BU/Service has been unselected.

 
 
Not "without anyone having set up anything specific", but you can change the setting in postgresql.conf to:
 
log_statement = 'all'
 
and reload the settings.
 
You can now see all SQL executed in the log and can debug what's going on.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Reply | Threaded
Open this post in threaded view
|

Re: Transactions

Fabio Pardi
In reply to this post by Karl Martin Skoldebrand
Hi Karl Martin,

you could set log_min_duration_statement=0 at the global level (in the config file) or at session level too.

regards,

fabio pardi




On 09/04/2019 11:26, Karl Martin Skoldebrand wrote:

> Hi,
>
>  
>
> Is there a way to track “transactions” by default (i.e. without anyone having set up anything specific). The problem I am facing is that users are claiming that settings are disappearing with them doing anything to affect them. It would be good to be able to see what postgresql thinks is going on.
>
> /*Subscriber adds Severity/BU/Service by ticking the corresponding box in subscriber configuration in WEBAPP. This works for some time./
>
> /*Subscriber stops receiving selected [tickets]./
>
> /*Upon checking settings the selected Severity/BU/Service has been unselected./
>
>  
>
> /M.
>
>  
>
> ============================================================================================================================
>
> Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.
>
> ============================================================================================================================
>


Reply | Threaded
Open this post in threaded view
|

RE: Transactions

Karl Martin Skoldebrand
In reply to this post by Andreas Joseph Krogh-2

How much impact on performance and disk space would this or

set log_min_duration_statement=0

have?

 

I have no idea as to how common this is, or when it happens, so it would need to run until this reported again (or some reasonable time if it doesn’t happen).

 

/M.

 

From: Andreas Joseph Krogh <[hidden email]>
Sent: 09 April 2019 11:41
To: [hidden email]
Subject: Sv: Transactions

 

På tirsdag 09. april 2019 kl. 11:26:29, skrev Karl Martin Skoldebrand <[hidden email]>:

Hi,

 

Is there a way to track “transactions” by default (i.e. without anyone having set up anything specific). The problem I am facing is that users are claiming that settings are disappearing with them doing anything to affect them. It would be good to be able to see what postgresql thinks is going on.

*Subscriber adds Severity/BU/Service by ticking the corresponding box in subscriber configuration in WEBAPP. This works for some time.

*Subscriber stops receiving selected [tickets].

*Upon checking settings the selected Severity/BU/Service has been unselected.

 

 

Not "without anyone having set up anything specific", but you can change the setting in postgresql.conf to:

 

log_statement = 'all'

 

and reload the settings.

 

You can now see all SQL executed in the log and can debug what's going on.

============================================================================================================================

Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.

============================================================================================================================

Reply | Threaded
Open this post in threaded view
|

Sv: RE: Transactions

Andreas Joseph Krogh-2
På tirsdag 09. april 2019 kl. 11:56:28, skrev Karl Martin Skoldebrand <[hidden email]>:

How much impact on performance and disk space would this or

set log_min_duration_statement=0

have?

 

I have no idea as to how common this is, or when it happens, so it would need to run until this reported again (or some reasonable time if it doesn’t happen).

Well, the answer here is of course "it depends"...
If you have lots of activity the logs will fill up quite quickly, but you can easily test this in production and just turn off logging again by setting it to 'none' and reload settings (no need to restart).
 
You can also only log modifications by setting
log_statement = 'mod'
 
Also watch out for triggers modifying stuff.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Reply | Threaded
Open this post in threaded view
|

Re: Transactions

Achilleas Mantzios
In reply to this post by Karl Martin Skoldebrand
On 9/4/19 12:26 μ.μ., Karl Martin Skoldebrand wrote:

Hi,

 

Is there a way to track “transactions” by default (i.e. without anyone having set up anything specific). The problem I am facing is that users are claiming that settings are disappearing with them doing anything to affect them. It would be good to be able to see what postgresql thinks is going on.

*Subscriber adds Severity/BU/Service by ticking the corresponding box in subscriber configuration in WEBAPP. This works for some time.

*Subscriber stops receiving selected [tickets].

*Upon checking settings the selected Severity/BU/Service has been unselected.


If what you need is business-like trail to specific relations (tables) (most probably what you need) then you may find pgaudit very useful. Its author dwsteele also wrote pgbackrest, as a tool it works wonders and the support is superb.

 

/M.

 

============================================================================================================================

Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.

============================================================================================================================



-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
Reply | Threaded
Open this post in threaded view
|

Re: Transactions

Melvin Davidson-5
In addition to what Andreas has suggested, you should also verify user claims by
A. Have them show you the query they executed,
B. Verify they have appropriate SELECT, INSERT, UPDATE ad/or DELETE permissions
on the tables involved.


On Tue, Apr 9, 2019 at 6:10 AM Achilleas Mantzios <[hidden email]> wrote:
On 9/4/19 12:26 μ.μ., Karl Martin Skoldebrand wrote:

Hi,

 

Is there a way to track “transactions” by default (i.e. without anyone having set up anything specific). The problem I am facing is that users are claiming that settings are disappearing with them doing anything to affect them. It would be good to be able to see what postgresql thinks is going on.

*Subscriber adds Severity/BU/Service by ticking the corresponding box in subscriber configuration in WEBAPP. This works for some time.

*Subscriber stops receiving selected [tickets].

*Upon checking settings the selected Severity/BU/Service has been unselected.


If what you need is business-like trail to specific relations (tables) (most probably what you need) then you may find pgaudit very useful. Its author dwsteele also wrote pgbackrest, as a tool it works wonders and the support is superb.

 

/M.

 

============================================================================================================================

Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.

============================================================================================================================



-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt


--
Melvin Davidson
Maj. Database & Exploration Specialist

Universe Exploration Command – UXC

Employment by invitation only!