Re: ON CONFLICT DO NOTHING ignored on bulk insert

2021-05-25 Thread Hellmuth Vargas
https://www.postgresql.org/docs/11/sql-insert.html#SQL-ON-CONFLICT "The optional ON CONFLICT clause specifies an alternative action to raising a *unique violation or exclusion constraint violation* error." El mar, 25 de may. de 2021 a la(s) 03:29, Geoff Winkless ( pgsqlad...@geoff.dj) escribi贸:

PostgreSQL log query's result size

2021-04-07 Thread Hellmuth Vargas
Excuse me in advance for my English, I'm improving :-) Could you tell me if it is possible that in addition to the configuration that the log presents the duration of the delayed queries, it can also present the size of the result data? especially those who want to return a lot of information. My

Re: count(*) vs count(id)

2021-02-02 Thread Hellmuth Vargas
Hello list My English is not very good, so I pretend that through the examples you understand what I intend to expose -- Recreate the query that is supposedly wrong select calendar.entry, count(*) from generate_series('2020-08-20'::date, '2020-09-15'::date, '1 day'::interval) as calendar(entry)

Re: Partitioned Table conversion to Non-Partition table in postgresql open source

2020-12-28 Thread Hellmuth Vargas
Hi I had already read about some procedures to do that https://www.enterprisedb.com/blog/postgres-partition-upgrade-your-partitioning-inheritance-declarative https://www.2ndquadrant.com/en/blog/how-to-migrate-from-inheritance-based-partitioning-to-declarative-partitioning-in-postgresql/ El lun

Re: Detecting which columns a query will modify in a function called by a trigger

2020-03-03 Thread Hellmuth Vargas
hello By means of json you can detect what change between NEW and OLD example: select b.* from (values (now(),123456,'pepito perez',false)) as old(dato1,dato2,dato3,dato4),json_each_text(row_to_json(old)) as b(text1,text2) except select b.* from (values (now(),98765,'pepi

Re: PG Upgrade with hardlinks, when to start/stop master and replicas

2019-02-19 Thread Hellmuth Vargas
Thank you Stephen 馃憤 El mar., 19 de feb. de 2019 a la(s) 10:05, Stephen Frost (sfr...@snowman.net) escribi贸: > Greetings, > > * Hellmuth Vargas (hiv...@gmail.com) wrote: > > But could you do the following procedure?: > > > pg_upgrade of the master > > rysnc wi

Re: PG Upgrade with hardlinks, when to start/stop master and replicas

2019-02-19 Thread Hellmuth Vargas
Hi But could you do the following procedure?: pg_upgrade of the master rysnc with a hot standby arracar master hot standby start stop hot standby and rsync the other hot standby with the migrated hot standby? El mar., 19 de feb. de 2019 a la(s) 06:12, Stephen Frost (sfr...@snowman.net) escribi贸:

Re: PG Upgrade with hardlinks, when to start/stop master and replicas

2019-02-18 Thread Hellmuth Vargas
Hola Martin Pues si uno sigue la secuencia de la pagina de ayuda de PostgreSQL https://www.postgresql.org/docs/10/pgupgrade.html Usage (...) 7. Stop both servers (...) 10. Upgrade Streaming Replication and Log-Shipping standby servers (...) 12. Start the new server *The new server can now be sa

Re: How duplicate values inserted into the primary key column of table and how to fix it

2019-01-24 Thread Hellmuth Vargas
Hi you could provide the definition of the table that includes the definition of the primary key? El jue., 24 de ene. de 2019 a la(s) 09:18, Raghavendra Rao J S V ( raghavendra...@gmail.com) escribi贸: > Hi All, > > > We are using Postgresql 9.2 database. > > > > In one of the transactional table,

Re: Idle query that's not ""?

2018-11-06 Thread Hellmuth Vargas
Hi In the documentation describes the data in this field: https://www.postgresql.org/docs/10/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW "Text of this backend's most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that

Re: Postgres 10, slave not catching up with master

2018-10-24 Thread Hellmuth Vargas
es (40k) and many upserts. > > > Boris > > On Tue, Oct 23, 2018 at 8:24 PM, Hellmuth Vargas wrote: > >> Hi >> >> Both servers are configured with the same date, time and time >> configuration? >> >> El mar., 23 de oct. de 2018 a la(s) 13:16, Hell

Re: Postgres 10, slave not catching up with master

2018-10-23 Thread Hellmuth Vargas
Hi Both servers are configured with the same date, time and time configuration? El mar., 23 de oct. de 2018 a la(s) 13:16, Hellmuth Vargas (hiv...@gmail.com) escribi贸: > Hi > > which result you get from the following query: > > SELECT CASE WHEN pg_last_wal_receive_lsn() = pg_last

Re: Postgres 10, slave not catching up with master

2018-10-23 Thread Hellmuth Vargas
t; > > Boris > > On Tue, Oct 23, 2018 at 3:10 PM, Hellmuth Vargas wrote: > >> Hi >> >> can share recovery.conf file settings?? >> >> El mar., 23 de oct. de 2018 a la(s) 00:28, Boris Sagadin ( >> bo...@infosplet.com) escribi贸: >> >>> Yes, t

Re: Postgres 10, slave not catching up with master

2018-10-23 Thread Hellmuth Vargas
Hi can share recovery.conf file settings?? El mar., 23 de oct. de 2018 a la(s) 00:28, Boris Sagadin ( bo...@infosplet.com) escribi贸: > Yes, turning wal_compression off improves things. Slave that was mentioned > unfortunately lagged too much before this setting was applied and was > turned off.

Re: Select "todays" timestamps in an index friendly way

2018-10-23 Thread Hellmuth Vargas
truncated to > >> days' > > > > That's what I am (was, thanks to Francisco) looking for. > > Then use current_date: > >where ts >= current_date > and ts < current_date + 1 > > > this is equally valid? where ts >= current_date cordialmente: Hellmuth Vargas

Re: Optimizing execution of expensive subqueries

2018-07-11 Thread Hellmuth Vargas
Hi Try this way: SELECT tbl.field1, tbl.field2, tbl.field3, ..., b.Thingy1Sum, ... repeat for multiply thingies ... FROM tbl LATERAL JOIN ( SELECT anothertbl.UserId,SUM(Duration) as Thingy1Sum FROM anothertbl WHERE anothertbl.UserId = tbl.UserId AND anothertbl.ThingyId = 1 group by 1)

Re: Split daterange into sub periods

2018-07-05 Thread Hellmuth Vargas
Hi select ($$[$$|| to_char(min(n.dato),'-MM-DD') || $$,$$ || to_char(max(n.dato),'-MM-DD') || $$]$$)::daterange, daterange(min(n.dato)::date,max(n.dato)::date) from ( select u.dato,anterior,(u.dato-anterior)::interval,sum(case when anterior is null or (u.dato -anterior)::interval='1 day'::

Re: Is postorder tree traversal possible with recursive CTE's?

2018-06-20 Thread Hellmuth Vargas
Hertroys ( haram...@gmail.com) escribi贸: > On 19 June 2018 at 21:14, Hellmuth Vargas wrote: > > > > Hi > > > > with partial sum: > > > > with recursive pizza (name, step, ingredient, quantity, unit, rel_qty, > path, > > weight) > > as ( &g

Re: Is postorder tree traversal possible with recursive CTE's?

2018-06-19 Thread Hellmuth Vargas
perhaps. El mar., 19 de jun. de 2018 a la(s) 14:52, Rob Sargent ( robjsarg...@gmail.com) escribi贸: > > > On 06/19/2018 01:14 PM, Hellmuth Vargas wrote: > > > Hi > > with partial sum: > > > > > with recursive pizza (name, step, ingredient, quanti

Re: Is postorder tree traversal possible with recursive CTE's?

2018-06-19 Thread Hellmuth Vargas
150.00 | g | 150.00 | 200.00 | 313.00 2.2.2 | water|50.00 | 50.00 | g | 50.00 | 200.00 | 313.00 2.2.3 | salt | 1.00 |1.00 | pinch || 200.00 | 313.00 (9 rows) El mar., 19 de jun. de 2018 a la(s) 11:49, Hellmuth Vargas (hiv...@g

Re: Is postorder tree traversal possible with recursive CTE's?

2018-06-19 Thread Hellmuth Vargas
Hi with recursive pizza (name, step, ingredient, quantity, unit, rel_qty, path, weight) as ( select name, step, ingredient, quantity, unit , quantity::numeric(10,2) , step::text , case when unit = 'g' then quantity::numeric(10,2) el

Re: Crear Una FUNTION usando ROW_NUMBER

2018-02-20 Thread Hellmuth Vargas
Hola Yeli Respondo entre lineas El 20 de febrero de 2018, 12:26, yeli escribi贸: > Buen d铆a, estoy intento crear un c贸digo concatenada a trav茅s de una > funci贸n que haga lo siguiente: > > Tengo una base de datos postgresql que esta asociada a un software GIS. > > Basicamente es una tabla donde se

Re: One Partition by list is always chosen by planner

2017-11-21 Thread Hellmuth Vargas
Hi what is the value of the parameter "constraint_exclusion" (in postgresq.conf)? You must set: constraint_exclusion = partition 2017-11-20 17:54 GMT-05:00 legrand legrand : > Hello, > > after creating a table wiki_data_part with > partition by list (category); > > and creating partitions lik