Re: Using unlogged tables for web sessions

2020-04-17 Thread John DeSoi
> On Apr 16, 2020, at 1:39 PM, Stephen Carboni > wrote: > > I was wondering if anyone was using unlogged tables for website > sessions in production. I'm interested if it breaks the prevailing > opinion that you don't put sessions in PG. Popular CMS systems like Drupal use the database for w

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Achilleas Mantzios
On 17/4/20 6:14 μ.μ., Imre Samu wrote: > it killed my 200+ days uptime FreeBSD box :( . > As I describe above, those attachments are nowhere as files. > They are email attachments. Also we got about half TB of them. it is possible - that  some image is a "decompression bomb" ? /"Because of the

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Imre Samu
> it killed my 200+ days uptime FreeBSD box :( . > As I describe above, those attachments are nowhere as files. > They are email attachments. Also we got about half TB of them. it is possible - that some image is a "decompression bomb" ? *"Because of the efficient compression method used in Port

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Achilleas Mantzios
On 17/4/20 5:47 μ.μ., Steve Atkins wrote: If running an extension crashed your server you should look at how / why, especially if it corrupted your filesystem. That shouldn't happen on a correctly configured system, so the underlying issue might cause you other problems. Crashing postgresql,

Re: Replication issue

2020-04-17 Thread Sonam Sharma
Yes, you are right. It's for connection failover from application end. I have set up db replication using repmgr. Version : 9.5 On Fri, Apr 17, 2020, 8:15 PM Julien Rouhaud wrote: > On Fri, Apr 17, 2020 at 4:02 PM Adrian Klaver > wrote: > > > > On 4/17/20 6:31 AM, Sonam Sharma wrote: > > > I

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Steve Atkins
On 17/04/2020 13:37, Achilleas Mantzios wrote: Hello Dear List, we have a table holding email attachments as bytea, and we would like to filter out images of small dimensions, which are not of any value to our logic. I took a look at pg_image extension, tested it, and it proved problemati

Re: Could not resolve host name error in psycopg2

2020-04-17 Thread Paul Förster
Hi Adrian, > On 17. Apr, 2020, at 16:10, Adrian Klaver wrote: > > But most pools can grow and shrink in response to demand, so at some point > there are connect/disconnect cycles. yes, but it is a difference whether you see occasional growing and shrinking pool behavior, or the logs are flood

Re: Replication issue

2020-04-17 Thread Julien Rouhaud
On Fri, Apr 17, 2020 at 4:02 PM Adrian Klaver wrote: > > On 4/17/20 6:31 AM, Sonam Sharma wrote: > > I have setup db replication. And added below parameter in jdbc file . > > The connection is failing and it's throwing error like db doesn't exist > > on secondary server. > > > > jdbc:postgresql://

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Achilleas Mantzios
On 17/4/20 4:09 μ.μ., Adam Brusselback wrote: Why not extract and store that metadata with the image rather than trying to extract it to filter on at query time? That way you can index your height and width columns to speed up that filtering if necessary. Yes I thought of that, but those are

Re: Could not resolve host name error in psycopg2

2020-04-17 Thread Adrian Klaver
On 4/17/20 12:02 AM, Paul Förster wrote: Hi Adrian, On 17. Apr, 2020, at 03:00, Adrian Klaver wrote: Huh? Leaving open connections is not considered a good thing. In other words a connection should last for as long as it takes to get it's task done and then it should close. I basically ag

Re: Replication issue

2020-04-17 Thread Adrian Klaver
On 4/17/20 6:31 AM, Sonam Sharma wrote: I have setup db replication. And added below parameter in jdbc file . The connection is failing and it's throwing error like db doesn't exist on secondary server. jdbc:postgresql://:50001,172.29.195.216:50001/crowd?targetServerType=master&reWriteBatchedI

Re: performance of first exec of prepared statement

2020-04-17 Thread Rob Sargent
> On Apr 17, 2020, at 7:34 AM, Ted Toth wrote: > >  > > >> On Fri, Apr 17, 2020 at 8:28 AM Ted Toth wrote: >> >> >>> On Thu, Apr 16, 2020 at 8:09 PM Rob Sargent wrote: >>> On 4/16/20 6:15 PM, Adrian Klaver wrote: >>> > On 4/16/20 4:59 PM, Ted Toth wrote: >>> >> >>> >> >>> >> On Thu, Apr

Re: performance of first exec of prepared statement

2020-04-17 Thread Ted Toth
On Fri, Apr 17, 2020 at 8:28 AM Ted Toth wrote: > > > On Thu, Apr 16, 2020 at 8:09 PM Rob Sargent wrote: > >> On 4/16/20 6:15 PM, Adrian Klaver wrote: >> > On 4/16/20 4:59 PM, Ted Toth wrote: >> >> >> >> >> >> On Thu, Apr 16, 2020 at 6:29 PM Ted Toth > >> > wrote: >> >>

Replication issue

2020-04-17 Thread Sonam Sharma
I have setup db replication. And added below parameter in jdbc file . The connection is failing and it's throwing error like db doesn't exist on secondary server. jdbc:postgresql://:50001, 172.29.195.216:50001/crowd?targetServerType=master&reWriteBatchedInserts=true .PSQLException: FATAL: datab

Re: performance of first exec of prepared statement

2020-04-17 Thread Ted Toth
On Thu, Apr 16, 2020 at 8:09 PM Rob Sargent wrote: > On 4/16/20 6:15 PM, Adrian Klaver wrote: > > On 4/16/20 4:59 PM, Ted Toth wrote: > >> > >> > >> On Thu, Apr 16, 2020 at 6:29 PM Ted Toth >> > wrote: > >> > >> I've noticed that the first exec of an INSERT prepared

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Adam Brusselback
Why not extract and store that metadata with the image rather than trying to extract it to filter on at query time? That way you can index your height and width columns to speed up that filtering if necessary. You may be able to write a wrapper for a command line tool like imagemagic or something

easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Achilleas Mantzios
Hello Dear List, we have a table holding email attachments as bytea, and we would like to filter out images of small dimensions, which are not of any value to our logic. I took a look at pg_image extension, tested it, and it proved problematic, it killed my 200+ days uptime FreeBSD box :( .

Re: Is there a script and sample data to test the performance of postgresql?

2020-04-17 Thread David Rowley
On Fri, 17 Apr 2020 at 20:13, Kiwoong Choi wrote: > Is there a script and sample data to test the performance of postgresql? There is pgbench. https://www.postgresql.org/docs/current/pgbench.html David

Is there a script and sample data to test the performance of postgresql?

2020-04-17 Thread Kiwoong Choi
Hi, Is there a script and sample data to test the performance of postgresql? Regards, Kiwoong

Re: Using unlogged tables for web sessions

2020-04-17 Thread Steve Atkins
On 16/04/2020 19:39, Stephen Carboni wrote: Hello. I was wondering if anyone was using unlogged tables for website sessions in production. I'm interested if it breaks the prevailing opinion that you don't put sessions in PG. I generally put sessions in postgresql, with regular tables, when I

Pgbackrest restore options

2020-04-17 Thread Konireddy Rajashekar
Hi Teaam, Doubt regarding the backrest restore options, is there any way to ensure the backups are good as expected, instead of restoring the whole cluster or database is there any other possibility to ensure it by restoring a single file? or any other such mechanism Thanks, Raj

Re: Could not resolve host name error in psycopg2

2020-04-17 Thread Paul Förster
Hi Adrian, > On 17. Apr, 2020, at 03:00, Adrian Klaver wrote: > > Huh? Leaving open connections is not considered a good thing. In other words > a connection should last for as long as it takes to get it's task done and > then it should close. I basically agree on this, but there are two big