Re: In which session context is a trigger run?

2018-12-29 Thread Adrian Klaver
On 12/28/18 11:44 PM, Mitar wrote: Hi! On Fri, Dec 28, 2018 at 9:36 PM Adrian Klaver wrote: When you create the temporary function it is 'pinned' to a particular session/pg_temp_nn. Running the trigger in another session 'pins' it to that session and it is not able to see the posts_temp table

Re: Using placeholders when creating a materialized view

2018-12-29 Thread Adrian Klaver
On 12/29/18 12:07 AM, Mitar wrote: Hi! Is it possible to use placeholders and provide values to the query when creating a materialized view? It looks like direct passing of values to the query is not possible and I have to encode them? The only way I could see to do that is using dynamic SQL i

Re: getting pg_basebackup to use remote destination

2018-12-29 Thread Adrian Klaver
On 12/29/18 11:04 AM, Chuck Martin wrote: I thought I knew how to do this, but I apparently don't. I have to set up a new server as a standby for a PG 11.1 server. The main server has a lot more resources than the standby. What I want to do is run pg_basebackup on the main server with the outpu

getting pg_basebackup to use remote destination

2018-12-29 Thread Chuck Martin
I thought I knew how to do this, but I apparently don't. I have to set up a new server as a standby for a PG 11.1 server. The main server has a lot more resources than the standby. What I want to do is run pg_basebackup on the main server with the output going to the data directory on the new serve

Recursive CTE

2018-12-29 Thread Glenn Schultz
All, Following my earlier post on variable instantiation, I rethought how I was working with dates and realized I can fix the date and use static interval. I came up with this recursive CTE which is the end goal. However, the problem is that the convexity query cannot be used as a subquery. So I

Re: initialize and use variable in query

2018-12-29 Thread Glenn Schultz
Thanks! On Sat, Dec 29, 2018 at 10:06 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Saturday, December 29, 2018, Ray O'Donnell wrote: >> >> A couple of things off the top of my head: > > > Sorry but, no. > >> >> (i) I think you need "language plpgsql" (or whatever) after the DO

Re: libpq bug?

2018-12-29 Thread Igor Korot
Hi, On Sat, Dec 29, 2018 at 1:37 AM patrick keshishian wrote: > > On Fri, Dec 28, 2018 at 5:40 PM Igor Korot wrote: >> >> Hi, Patrick, >> >> Here is my new code: >> >> int PostgresDatabase::GetTableOwner (const std::wstring &schemaName, >> const std::wstring &tableName, std::wstring &owner, >> s

initialize and use variable in query

2018-12-29 Thread David G. Johnston
On Saturday, December 29, 2018, Ray O'Donnell wrote: > > A couple of things off the top of my head: Sorry but, no. > > (i) I think you need "language plpgsql" (or whatever) after the DO block. As the docs state plpgsql is the default for a DO block lacking a language specifier. > (ii) That

Re: initialize and use variable in query

2018-12-29 Thread David G. Johnston
On Saturday, December 29, 2018, Glenn Schultz wrote: > All, > > I need to initialize a variable and then use it in query. Ultimately this > will part of a recursive CTE but for now I just need to work this out. I > followed the docs and thought I needed something like this. But does not > work

Re: initialize and use variable in query

2018-12-29 Thread Ray O'Donnell
On 29/12/2018 15:40, Glenn Schultz wrote: All, I need to initialize a variable and then use it in query. Ultimately this will part of a recursive CTE but for now I just need to work this out.  I followed the docs and thought I needed something like this.  But does not work-maybe I have misun

initialize and use variable in query

2018-12-29 Thread Glenn Schultz
All, I need to initialize a variable and then use it in query. Ultimately this will part of a recursive CTE but for now I just need to work this out. I followed the docs and thought I needed something like this. But does not work-maybe I have misunderstood. Is this possible? SET max_parallel_

Using placeholders when creating a materialized view

2018-12-29 Thread Mitar
Hi! Is it possible to use placeholders and provide values to the query when creating a materialized view? It looks like direct passing of values to the query is not possible and I have to encode them? Mitar -- http://mitar.tnode.com/ https://twitter.com/mitar_m