Re: Duplicate key violation on upsert

2020-03-25 Thread Adrian Klaver
On 3/25/20 5:23 PM, Matt Magoffin wrote: On 23/03/2020, at 1:10 PM, Adrian Klaver > wrote: So the query is in the function solardatum.store_datum()? If so what is it doing? Yes. This function first performs the INSERT INTO the solardatum.da_datum table tha

Re: PG12 autovac issues

2020-03-25 Thread Michael Paquier
On Wed, Mar 25, 2020 at 07:59:56PM -0700, Andres Freund wrote: > FWIW, this kind of thing is why I think the added skipping logic is a > bad idea. Silently skipping things like this (same with the "bogus" > logic in datfrozenxid computation) is dangerous. I think we should > seriously consider back

Re: PG12 autovac issues

2020-03-25 Thread Andres Freund
Hi, On 2020-03-26 10:43:36 +0900, Michael Paquier wrote: > On Wed, Mar 25, 2020 at 10:39:17AM -0500, Justin King wrote: > > Mar 25 14:48:26 cowtn postgres[39875]: [35298-1] 2020-03-25 > > 14:48:26.329 GMT [39875] DEBUG: skipping redundant vacuum to prevent > > wraparound of table "postgres.pg_cat

Re: PG12 autovac issues

2020-03-25 Thread Michael Paquier
On Wed, Mar 25, 2020 at 10:39:17AM -0500, Justin King wrote: > This started happening again. DEBUG1 is enabled: Thanks for enabling DEBUG1 logs while this happened. > Mar 25 14:48:26 cowtn postgres[39875]: [35298-1] 2020-03-25 > 14:48:26.329 GMT [39875] DEBUG: skipping redundant vacuum to preve

Re: PostgreSQL 13: native JavaScript Procedural Language support ?

2020-03-25 Thread Bruce Momjian
On Wed, Mar 25, 2020 at 05:46:27PM +0200, Marius Andreiana wrote: > Thanks Tom, that makes sense. Appreciate your time to explain the context. > > I'll followup with Heroku. Also, I have heard PL/V8 is very hard to build for packagers (because of changes by Google in the way V8 is packaged), whic

Re: Duplicate key violation on upsert

2020-03-25 Thread Matt Magoffin
> On 23/03/2020, at 1:10 PM, Adrian Klaver wrote: > > So the query is in the function solardatum.store_datum()? > > If so what is it doing? Yes. This function first performs the INSERT INTO the solardatum.da_datum table that we’re discussing here; then it inserts into two different tables. I

Re: PG 12: Partitioning across a FDW?

2020-03-25 Thread Chris Morris
Right now my dbs are hosted by Heroku, so I doubt I have any control over the dbs at that level. Thanks for the idea though! :) On Wed, Mar 25, 2020 at 12:04 PM Michael Lewis wrote: > Chris, > Does it actually need to be a different server and database, or would it > be possible to have another

Re: PG 12: Partitioning across a FDW?

2020-03-25 Thread Michael Lewis
Chris, Does it actually need to be a different server and database, or would it be possible to have another storage device added to your existing database and make use of tablespaces to accomplish pseudo-archive of older partitions? Just a thought. >

Re: PG 12: Partitioning across a FDW?

2020-03-25 Thread Chris Morris
> > Not yet.. There is ongoing work to make that happen though. Glad to hear it. :) Thx.

Re: PG 12: Partitioning across a FDW?

2020-03-25 Thread Stephen Frost
Greetings, * Laurenz Albe (laurenz.a...@cybertec.at) wrote: > On Tue, 2020-03-24 at 17:50 -0500, Chris Morris wrote: > > Is it even possible to use PG partitioning across a Foreign Server? > > I am not certain what you mean, but you can have foreign tables as partitions > of a partitioned table.

Re: PG 12: Partitioning across a FDW?

2020-03-25 Thread Chris Morris
> > > Is it even possible to use PG partitioning across a Foreign Server? > I am not certain what you mean, but you can have foreign tables as > partitions > of a partitioned table. The partitions won't be processed in parallel > though. I have a large, growing table, that I'd like to start part

Re: PostgreSQL 13: native JavaScript Procedural Language support ?

2020-03-25 Thread Marius Andreiana
Thanks Tom, that makes sense. Appreciate your time to explain the context. I'll followup with Heroku. Have a peaceful day, Marius On Wed, Mar 25, 2020 at 4:50 PM Tom Lane wrote: > Marius Andreiana writes: > > How about enabling users to do more advanced processing of JSON > > data inside the

Re: PG12 autovac issues

2020-03-25 Thread Justin King
All- This started happening again. DEBUG1 is enabled: Mar 25 14:48:03 cowtn postgres[39720]: [35294-1] 2020-03-25 14:48:03.972 GMT [39720] DEBUG: autovacuum: processing database "template0" Mar 25 14:48:06 cowtn postgres[39735]: [35294-1] 2020-03-25 14:48:06.545 GMT [39735] DEBUG: autovacuum:

RE: How to query "primary_slot_name" in slave server?

2020-03-25 Thread Edson Richter
De: Paul Förster Enviado: quarta-feira, 25 de março de 2020 11:42 Para: Edson Richter Cc: pgsql-general Assunto: Re: How to query "primary_slot_name" in slave server? Hi Edson, query the following on the replica: pg_stat_wal_receiver Perfect, thanks! Edson Cheers, Paul > On 25. Mar, 20

Re: PostgreSQL 13: native JavaScript Procedural Language support ?

2020-03-25 Thread Tom Lane
Marius Andreiana writes: > How about enabling users to do more advanced processing of JSON > data inside the database itself, using JavaScript? > There's the PLV8 extension https://github.com/plv8/plv8 > but it's not available for many major db providers (eg Heroku), making it > hard to adopt it.

Re: How to query "primary_slot_name" in slave server?

2020-03-25 Thread Paul Förster
Hi Edson, query the following on the replica: pg_stat_wal_receiver Cheers, Paul > On 25. Mar, 2020, at 13:59, Edson Richter wrote: > > Hi! > > I've been searching over the net, but cannot find a reference. > I know that in server I can execute "select * from pg_replication_slots" and > get

Re: Replacing Apache Solr with Postgre Full Text Search?

2020-03-25 Thread Mike Rylander
On Wed, Mar 25, 2020 at 8:37 AM J2eeInside J2eeInside wrote: > > Hi all, > > I hope someone can help/suggest: > I'm currently maintaining a project that uses Apache Solr /Lucene. To be > honest, I wold like to replace Solr with Postgre Full Text Search. However, > there is a huge amount of docu

Re: PLPGSQL: when the local variable used and when the table field?

2020-03-25 Thread David G. Johnston
On Wed, Mar 25, 2020 at 6:09 AM Durumdara wrote: > > What would happen? > The working procedure makes error, because it have more possible source of > data (local variable, and table field)? > Or it uses the local variable, because in the scope it has more precedency? > [...] > > Do you know any

PLPGSQL: when the local variable used and when the table field?

2020-03-25 Thread Durumdara
Hello! PLPGSQL allows me to write simple queries and updates without execute + using. F.e: DECLARE t text; anytype text; BEGIN ... select nev into t from anytable where type = anytype; ... insert into bla (id, name, type) select id, name, anytype from bla ... But this method is seems to be

Re: How to plpgsql scripting

2020-03-25 Thread Ekaterina Amez
El mié., 25 mar. 2020 a las 13:54, David G. Johnston (< david.g.johns...@gmail.com>) escribió: > On Wednesday, March 25, 2020, Ekaterina Amez > wrote: >> >> What's wrong with the syntax? Or is not possible to make a script and I >> have to create a function to encapsulate my code? >> > This not w

Re: PLPGSQL: DECLARE more variable with same type at once

2020-03-25 Thread Pavel Stehule
st 25. 3. 2020 v 13:53 odesílatel Durumdara napsal: > Hello! > > I want to ask how to shortening code? > > Delta double precision; > UjErtek double precision; > UjDErtek double precision; > > For example - but this makes an error: > Delta, UjErtek, UjDErtek double precision; > > D

Re: How to plpgsql scripting

2020-03-25 Thread Ekaterina Amez
El mié., 25 mar. 2020 a las 13:42, Pavel Stehule () escribió: > > just this is not supported feature. > I was affraid this was going to be the answer.. sigh > You have some special reason why you use 8.4? It's pretty old unsupported > version. > As I said: legacy server. I'm planning upgrade i

Re: PLPGSQL: DECLARE more variable with same type at once

2020-03-25 Thread David G. Johnston
On Wednesday, March 25, 2020, Durumdara wrote: > Hello! > > I want to ask how to shortening code? > > Delta double precision; > UjErtek double precision; > UjDErtek double precision; > > For example - but this makes an error: > Delta, UjErtek, UjDErtek double precision; > > Do you

How to query "primary_slot_name" in slave server?

2020-03-25 Thread Edson Richter
Hi! I've been searching over the net, but cannot find a reference. I know that in server I can execute "select * from pg_replication_slots" and get all created slots. But how can I query slave to know wich primay slot it is connecting to? Thanks in advance, Edson

Re: How to plpgsql scripting

2020-03-25 Thread David G. Johnston
On Wednesday, March 25, 2020, Ekaterina Amez wrote: > > What's wrong with the syntax? Or is not possible to make a script and I > have to create a function to encapsulate my code? > This not working exactly the reason the “DO” command was created. David J.

PLPGSQL: DECLARE more variable with same type at once

2020-03-25 Thread Durumdara
Hello! I want to ask how to shortening code? Delta double precision; UjErtek double precision; UjDErtek double precision; For example - but this makes an error: Delta, UjErtek, UjDErtek double precision; Do you know any other form? Thank you for it! Best regards dd

Re: How to plpgsql scripting

2020-03-25 Thread Pavel Stehule
st 25. 3. 2020 v 13:20 odesílatel Ekaterina Amez napsal: > Hi List, > > I'm used to make my own scripts in Oracle plsql, Sql Server tsql... but > I'm unable to make one simple script in Postgres. > > Objective version is 8.4 (I know, I know... it's a legacy server, I'm > planning upgrade this ser

Replacing Apache Solr with Postgre Full Text Search?

2020-03-25 Thread J2eeInside J2eeInside
Hi all, I hope someone can help/suggest: I'm currently maintaining a project that uses Apache Solr /Lucene. To be honest, I wold like to replace Solr with Postgre Full Text Search. However, there is a huge amount of documents involved - arround 200GB. Wondering, can Postgre handle this efficientl

How to plpgsql scripting

2020-03-25 Thread Ekaterina Amez
Hi List, I'm used to make my own scripts in Oracle plsql, Sql Server tsql... but I'm unable to make one simple script in Postgres. Objective version is 8.4 (I know, I know... it's a legacy server, I'm planning upgrade this server as soon as I can). I have a test server with 9.2 version wher

RE: PostgreSQL10.x client Vs. PostgreSQL 11.x server

2020-03-25 Thread Deepti Sharma S
Hi Jimmy, If I would change my question, that if customer will be having PostgreSQL client 11.x version and PostgreSQL 10.x as server, will that be compatible? [Ericsson] DEEPTI SHARMA Specialist ITIL 2011 Foundation Certified BDGS, R&D Ericsson 3rd Floor, ASF Insigni

Re: PostgreSQL10.x client Vs. PostgreSQL 11.x server

2020-03-25 Thread Jimmy Angelakos
Hi Deepti, As Peter pointed out (and I should have clarified), the server-side features of each version should work regardless of client. So the pg11 client will support all of the features of pg10 server (should be fully compatible). Best regards, Jimmy Jimmy Angelakos Senior PostgreSQL Archite

Re: PG 12: Partitioning across a FDW?

2020-03-25 Thread Laurenz Albe
On Tue, 2020-03-24 at 17:50 -0500, Chris Morris wrote: > Is it even possible to use PG partitioning across a Foreign Server? I am not certain what you mean, but you can have foreign tables as partitions of a partitioned table. The partitions won't be processed in parallel though. Yours, Laurenz