Re: Working with fixed-point calculations in C

2021-12-07 Thread Tom Lane
Oskar Stenberg writes: > I need to make some fixed-point calculations inside the C code that I'm > developing as an extension to PostgreSQL. I was reading a bit, and if I > understood the datatype NUMBER correctly, it seems to be just what I'm > looking for, a fixed-point datatype. (I couldn't act

Re: CTE Materialization

2021-12-07 Thread David G. Johnston
On Tue, Dec 7, 2021 at 6:40 PM Дмитрий Иванов wrote: > I beg your pardon. > The problem is more or less clear to me, but the solution is not. What > does the "hack is to add an "offset 0" to the query" suggest? Thank you. > > A subquery with a LIMIT clause cannot have where clause expressions in

Re: CTE Materialization

2021-12-07 Thread Дмитрий Иванов
I beg your pardon. The problem is more or less clear to me, but the solution is not. What does the "hack is to add an "offset 0" to the query" suggest? Thank you. -- Regards, Dmitry! вт, 7 дек. 2021 г. в 10:20, Paul van der Linden : > It did indeed work as expected. > Took the query down from ov

Working with fixed-point calculations in C

2021-12-07 Thread Oskar Stenberg
Hi! I need to make some fixed-point calculations inside the C code that I'm developing as an extension to PostgreSQL. I was reading a bit, and if I understood the datatype NUMBER correctly, it seems to be just what I'm looking for, a fixed-point datatype. (I couldn't actually find any thing in the

error connecting to pgbouncer admin console

2021-12-07 Thread Zwettler Markus (OIZ)
I did a pgbouncer configuration using the following ini file: [databases] * = host=localhost port=5433 auth_user=pgbouncer [users] [pgbouncer] logfile = /pgdata/pcl_l002/pgbouncer/pgbouncer_pcl_l002.log pidfile = /pgdata/pcl_l002/pgbouncer/pgbouncer_pcl_l002.pid listen_addr = * listen_port = 643

Re: When Update balloons memory

2021-12-07 Thread Tom Lane
Klaudie Willis writes: > The following statement below, when not divided up into chunks, but run > across all 800M rows, did trigger an OOM-kill from the OS. An UPDATE should only result in memory bloat if it's queuing trigger events to be processed at end-of-statement. You claim there are no t

Re: how to get value of parameter set in session for other user

2021-12-07 Thread Tom Lane
Vikas Sharma writes: > Is it possible in postgres to get the value of the parameter currently set > in the session of the other user? No. That information only exists within the other session's process. regards, tom lane

Re: When Update balloons memory

2021-12-07 Thread Francisco Olarte
This has no solution for the issue but... On Tue, 7 Dec 2021 at 10:16, Klaudie Willis wrote: > Ubuntu 20.04, 64GB ram, 16GB shared buffer, 500 MB working mem, Postgresql > 14.1 ... > shared_buffers = 16GB > effective_cache_size = 48GB ... You are not going to have total ram - shared buffers in t

Re: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT

2021-12-07 Thread Francisco Olarte
Alan: On Mon, 6 Dec 2021 at 18:58, Alan Hodgson wrote: > On Mon, 2021-12-06 at 18:20 +0100, Francisco Olarte wrote: > Can you post an explain analyze? To me it seems like the planner > thinks shipment_import_id is randomly distributed and the table is > well correlated with it's PK, so scanning i

how to get value of parameter set in session for other user

2021-12-07 Thread Vikas Sharma
Hi There, Is it possible in postgres to get the value of the parameter currently set in the session of the other user? The other user might have set the value using SET . If the other user has set the value as "alter role" then it should appear in select * from pg_roles. Thank you -Vikas

Re: Advice on using materialized views

2021-12-07 Thread Wicher
On Mon, 06 Dec 2021 18:48:47 + "Phil Endecott" wrote: > and > I need to modify the definition of a view that filters the "new" > values from the raw table each time the materialised view is > refreshed. You won't necessarily need to rewrite the "recent data" view definitions, I think. Wh

When Update balloons memory

2021-12-07 Thread Klaudie Willis
About the system: Ubuntu 20.04, 64GB ram, 16GB shared buffer, 500 MB working mem, Postgresql 14.1 Core issue: The following statement below, when not divided up into chunks, but run across all 800M rows, did trigger an OOM-kill from the OS. I have looked into it by kernel logs as well as postgres