Re: Postgres trigger side-effect is occurring out of order with row-level security select policy

2018-10-02 Thread Dean Rasheed
On Mon, 1 Oct 2018 at 21:45, Carl Sverre wrote: > Dean, > Thank you for the pointer towards visibility/volatility. I think that > completely explains the effect that I am seeing in my repro. I experimented > with using a VOLATILE function for the SELECT RLS using statement and while > it comp

pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread pinker
Hi! There is second time I see that somebody uses pg_sleep function inside plpgsql block. This case is quite similar to the last one - it's some kind of wait for data to be loaded. After pg_sleep there is a check if some condition is true, if not procedure goes to sleep again. As a result an averag

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread Francisco Olarte
Hi: On Tue, Oct 2, 2018 at 12:10 PM, pinker wrote: > There is second time I see that somebody uses pg_sleep function inside > plpgsql block. This case is quite similar to the last one - it's some kind > of wait for data to be loaded. After pg_sleep there is a check if some > condition is true, if

Re: regarding bdr extension

2018-10-02 Thread Adrian Klaver
On 10/1/18 9:00 AM, Durgamahesh Manne wrote:  Hi  sir * Since you are on Ubuntu why not use the PGDG repo?:  in my company env  i am using pg installer to manage the postgres servers You have not said, but I am going to guess you are talking about Postgres Installer from 2nd Quadrant.

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread pinker
Francisco Olarte wrote > I do some similar things, but I sleep outside of the > database, is there a reason this can not be done? > > Francisco Olarte. Yes, I do try to convince them to do it outside the db, that's the reason I'm looking for some support here :) I'm not sure those 2 reasons are e

Re: regarding bdr extension

2018-10-02 Thread Andreas Kretschmer
Am 02.10.2018 um 15:29 schrieb Adrian Klaver: does this pgdg repository useful for configuration of bdr v3 ? BDR is a third party extension from 2nd Quadrant, they would be the ones to ask about configuring. i said it already, BDR3 is not for public, only for our customers. You will

Re: CREATE TABLE AS SELECT hangs

2018-10-02 Thread derek
Tom. Thanks so much for your response. Your theory appears to have been correct, and it is working like a champ now. Best, Derek On 10/1/2018 4:29 PM, Tom Lane wrote: derek writes: I am trying to populate/create a database with CREATE TABLE AS SELECT like so: CREATE TABLE test_table

Re: Postgres trigger side-effect is occurring out of order with row-level security select policy

2018-10-02 Thread Carl Sverre
Dean, Thank you for the pointer towards visibility/volatility. I think that completely explains the effect that I am seeing in my repro. I experimented with using a VOLATILE function for the SELECT RLS using statement and while it completely solves my issue, it incurs too high a cost for query ex

how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-02 Thread magodo
I read the document about recovery configuration, it says: recovery_target_timeline (string) ... Other than that you only need to set this parameter in complex re- recovery situations, where you need to return to a state that itself was reached after a point-in-time recovery. Se

Re: Postgres 11 procedures and result sets

2018-10-02 Thread Merlin Moncure
On Mon, Oct 1, 2018 at 6:57 PM Tom Lane wrote: > Jan Kohnert writes: > > I have a question regarding the new stored procedures in Postgres 11 (I > > tested > > beta4): > > I'd like to know if it is somehow possible to get a (or possibly more) > > result > > set from selects within the SP, as it

FTS trigger works 1 at a time, but fails with bulk insert script

2018-10-02 Thread Malik Rumi
I have set up Postgres FTS on a Django/Python web site, and it works as expected except for this one thing. When I wrote a script to bulk insert legacy docs, the script works fine but the FTS trigger does not fire. I have to go back and open each document one at a time to get them indexed. What am

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread Francisco Olarte
On Tue, Oct 2, 2018 at 3:44 PM, pinker wrote: ... > Yes, I do try to convince them to do it outside the db, that's the reason > I'm looking for some support here :) I'm not sure those 2 reasons are enough > to convince them, wanted to be prepared... Well, not knowing the logic I cannot be sure, b

Re: Postgres trigger side-effect is occurring out of order with row-level security select policy

2018-10-02 Thread Carl Sverre
Dean, Thank you for catching that bug, I have updated the StackOverflow answer to account for that issue. As for the optimization problem I mentioned, the issue seems to be that running a function that acquires a snapshot for each row is much slower than in-lining a nested loop over table b into t

metadata about creation and size of tables

2018-10-02 Thread Martin Mueller
I’ve looked at the documentation to find where to find some data that are very to find Mysql: the creation and modification data of a table and the size of particular tables. Where do I find an answer to the question “which is the last table I created” or “when did I last modify this table?”

How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-02 Thread David Gauthier
Hi: psql (9.6.7, server 9.5.2) on linux How does one get the status of an sql statement executed in plpgsql? If that status is cryptic, how can that be translated to something which someone could understand? Finally, how can I effectively do a start transaction and either rollback or commit bas

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-02 Thread Christopher Browne
On Tue, 2 Oct 2018 at 16:48, David Gauthier wrote: > > Hi: > psql (9.6.7, server 9.5.2) on linux > > How does one get the status of an sql statement executed in plpgsql? If that > status is cryptic, how can that be translated to something which someone > could understand? Finally, how can I e

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-02 Thread Adrian Klaver
On 10/2/18 1:47 PM, David Gauthier wrote: Hi: psql (9.6.7, server 9.5.2) on linux How does one get the status of an sql statement executed in plpgsql?  If that status is cryptic, how can that be translated to something which someone could understand?   Finally, how can I effectively do a start

Re: metadata about creation and size of tables

2018-10-02 Thread Adrian Klaver
On 10/2/18 1:38 PM, Martin Mueller wrote: I’ve looked at the documentation to find where to find some data that are very to find Mysql:  the creation and modification data of a table and the size of particular tables. Where do I find an answer to the question “which is the last table I create

Re: FTS trigger works 1 at a time, but fails with bulk insert script

2018-10-02 Thread Adrian Klaver
On 10/2/18 10:34 AM, Malik Rumi wrote: I have set up Postgres FTS on a Django/Python web site, and it works as expected except for this one thing. When I wrote a script to bulk insert legacy docs, the script works fine but the FTS trigger does not fire. I have to go back and open each document

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-02 Thread Laurenz Albe
magodo wrote: > I read the document about recovery configuration, it says: [...] > Therefore, suppose I am going to recover to a point of some child > timeline, to identify the point, I have to specify either > recovery_target_name or recovery_target_time, and also specify the > recovery_target_t

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread Laurenz Albe
pinker wrote: > Francisco Olarte wrote > > I do some similar things, but I sleep outside of the > > database, is there a reason this can not be done? > > > > Francisco Olarte. > > Yes, I do try to convince them to do it outside the db, that's the reason > I'm looking for some support here :) I'm