Best strategy to perform individual incremental backups

2023-08-14 Thread Mario Diangelo
Hello you all, We use different Windows servers with Postgresql and looking for the best strategy to create daily incremental backups to a (managed) volume. We want to achieve this with scripts and run them daily within the TaskSchedular. Point in time recovery seems to work only for the whole

Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Sai Teja
Hi Team, We are trying to fetch the one row of data (bytea data) for one table in But getting the error stating that "Invalid Memory alloc request size 1236252631" The row which we were trying to fetch have one bytea column which is more than 1GB Could anyone please help me to resolve this issue

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Andreas Kretschmer
On 14 August 2023 11:59:26 CEST, Sai Teja wrote: >Hi Team, > >We are trying to fetch the one row of data (bytea data) for one table in >But getting the error stating that "Invalid Memory alloc request size >1236252631" > >The row which we were trying to fetch have one bytea column which is mor

Re: Best strategy to perform individual incremental backups

2023-08-14 Thread Stephen Frost
Greetings, * Mario Diangelo (watisdit...@msn.com) wrote: > We use different Windows servers with Postgresql and looking for the best > strategy to create daily incremental backups to a (managed) volume. We want > to achieve this with scripts and run them daily within the TaskSchedular. > Point

Query plan regression between CTE and views

2023-08-14 Thread David Gilman
I have a query that was originally written as a handful of CTEs out of convenience. It is producing a reasonable query plan because the CTE materialization was kicking in at an appropriate place. The CTEs aren't totally linear. The graph looks like this, where A, B, C and D are CTEs, and B -> A mea

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Sai Teja
Could anyone please suggest any ideas to resolve this issue. I have increased the below parameters but still I'm getting same error. work_mem, shared_buffers Out of 70k rows in the table only for the few rows which is of large size (700MB) getting the issue. Am unable to fetch the data for that

Re: Query plan regression between CTE and views

2023-08-14 Thread Ron
On 8/14/23 09:54, David Gilman wrote: I have a query that was originally written as a handful of CTEs out of convenience. It is producing a reasonable query plan because the CTE materialization was kicking in at an appropriate place. The CTEs aren't totally linear. The graph looks like this, wher

How to optimize PostgreSQL Row Security Policies that involve related tables?

2023-08-14 Thread David Ventimiglia
Hello! What are some good ways to create Row Security Policies that restrict rows in one table using a filter on a related table, and get good performance? It's difficult to describe but let me try to explain. I'm using the venerable old Chinook database

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Rob Sargent
On 8/14/23 09:29, Sai Teja wrote: Could anyone please suggest any ideas to resolve this issue. I have increased the below parameters but still I'm getting same error. work_mem, shared_buffers Out of 70k rows in the table only for the few rows which is of large size (700MB) getting the issue.

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Sai Teja
I am just running select query to fetch the result Query : select id, content_data, name from table_name So here content_data is bytea content which is having more than 700 MB. Even if I run this query in any DB client such as Pgadmin, dbeaver etc.. I'm facing the same error. But this query is bein

Re: How to optimize PostgreSQL Row Security Policies that involve related tables?

2023-08-14 Thread David Ventimiglia
Sorry, I had a typo in my Row Policy. Rather, it should look like this: create policy album_rls_policy on "Track" for select to public using ( exists (select * from "Album" where "Album"."AlbumId" = "Track"."AlbumId") ); On Mon, Aug 14, 2023 at 9:36 AM David Ventimiglia < davidaventim

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Ron
Did you /try/ changing bytea_output to hex? On 8/14/23 12:31, Sai Teja wrote: I am just running select query to fetch the result Query : select id, content_data, name from table_name So here content_data is bytea content which is having more than 700 MB. Even if I run this query in any DB clien

Re: Dynamically accessing columns from a row type in a trigger

2023-08-14 Thread Rhys A.D. Stewart
Hello again > > Actually, now that I'm thinking about it, I don't really want to store > > the value into a variable because the pk_col might be of any given > > type. So ideally, I'd love a way to just get the value from OLD and > > use it directly in another query. Something along the lines of

Re: Dynamically accessing columns from a row type in a trigger

2023-08-14 Thread Rob Sargent
So the less obvious solution that works is to create a temporary table. A little verbose, but I get to keep the types. `CREATE TEMPORARY TABLE _ ON COMMIT DROP AS SELECT OLD.*;` _ as a table name makes things a little easier to type. Rhys Peace & Love | Live Long & Prosper If the connectio

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Sai Teja
By default the bytea_output is in hex format. On Tue, 15 Aug, 2023, 12:44 am Ron, wrote: > Did you *try* changing bytea_output to hex? > > On 8/14/23 12:31, Sai Teja wrote: > > I am just running select query to fetch the result > Query : select id, content_data, name from table_name > So here co

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Sai Teja
Hi team, I got to know the field size limit for the bytea datatype column is limited to 1 GB in postgreSQL. Then how can we increase this? Since we need to store high volume of data for each row in a table https://www.postgresql.org/docs/current/limits.html Any suggestions would be appreciated.

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Tom Lane
Sai Teja writes: > I got to know the field size limit for the bytea datatype column is limited > to 1 GB in postgreSQL. Then how can we increase this? You can't. That limit is wired-in in many ways. Think about how to split your data across multiple table rows. regards,