statistic target and sample rate

2021-07-14 Thread Luca Ferrari
Hi all, I've a doubt about the sampling rate about the statistic target. Documentation states that: "The largest statistics target among the columns being analyzed determines the number of table rows sampled to prepare the statistics. Increasing the target causes a proportional increase in the tim

Re: pg_wal lifecycle

2021-07-14 Thread Luca Ferrari
On Tue, Jul 13, 2021 at 3:43 PM Peter Eisentraut wrote: > Recycling in this context just means that instead of creating a new WAL > file for new WAL traffic, it reuses an old file. So if you have WAL > files 5, 6, 7, 8, 9, and you know that you don't need 5 and 6 anymore, > when you need to start

returning setof from insert ?

2021-07-14 Thread Laura Smith
Hi, A bit of pl/pgsql writer's block going on here ... Postgres complains "RETURN cannot have a parameter in function returning set" in relation to the below. I don't really want to have to "RETURNS TABLE" because that means I have to enumerate all the table columns. I'm sure I'm missing somet

Re: returning setof from insert ?

2021-07-14 Thread Magnus Hagander
On Wed, Jul 14, 2021 at 1:22 PM Laura Smith wrote: > > Hi, > > A bit of pl/pgsql writer's block going on here ... > > Postgres complains "RETURN cannot have a parameter in function returning set" > in relation to the below. I don't really want to have to "RETURNS TABLE" > because that means I ha

Re: returning setof from insert ?

2021-07-14 Thread Thomas Kellerer
Laura Smith schrieb am 14.07.2021 um 13:22: > A bit of pl/pgsql writer's block going on here ... > > Postgres complains "RETURN cannot have a parameter in function returning set" > in relation to the below. I don't really want to have to "RETURNS TABLE" > because that means I have to enumerate al

Re: returning setof from insert ?

2021-07-14 Thread Laura Smith
‐‐‐ Original Message ‐‐‐ On Wednesday, July 14th, 2021 at 1:14 PM, Thomas Kellerer wrote: > Laura Smith schrieb am 14.07.2021 um 13:22: > > > A bit of pl/pgsql writer's block going on here ... > > > > Postgres complains "RETURN cannot have a parameter in function returning > > set"

Re: statistic target and sample rate

2021-07-14 Thread Tom Lane
Luca Ferrari writes: > Therefore my question is about how the statistic collectore decides > about the number of tuples to be sampled. It's basically 300 times the largest statistics target: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/commands/analyze.c;h=0c9591415e4

ERROR: cannot freeze committed xmax

2021-07-14 Thread Sasha Aliashkevich
Hi, Few weeks ago at one of the databases we started to observe the following error in Postgresql logs: ERROR: cannot freeze committed xmax 572 For the note it's Postgresql 10.14 running on RHEL: version

Re: Why can't I drop a tablespace?

2021-07-14 Thread Phil Endecott
Tom Lane wrote: "Phil Endecott" writes: Thanks Laurenz. I was looking at the source for "alter table set tablespace" yesterday trying to work out what is supposed to happen. There is a comment at tablecmds.c line 3989: "Thanks to the magic of MVCC, an error anywhere along the way rolls back the

How to display stored image as bytea or as large objects?

2021-07-14 Thread Csanyi Pal
Hi, I am a novice in postgresql language. By reading the documentation about storing binary data in postgresql database, I realize that that one can store images as binary data by using bytea or BLOB data types. I am running postgresql on Ubuntu 20.04.2 LTS and using pgAdmin4 in Desktop mod

looping over multirange segments?

2021-07-14 Thread Ben Chobot
I'm really, really liking the multirange types in PG14. Thank you for making them! Unfortunately I am struggling with how to loop over the segments of a multirange. There doesn't seem to be a way to convert them to arrays, and I can't just use plpgsql's FOREACH on one. Am I missing something ob

Re: How to display stored image as bytea or as large objects?

2021-07-14 Thread Csanyi Pal
2021. 07. 14. 22:17 keltezéssel, Ho John Lee írta: If you have the binary data for the image in the bytea field, DBeaver will display the image when you select that field in table view of the data. The field will display something like "ÿØÿà  JFIF   [n]" in the row (first part of data as uni