Re: How to properly fix memory leak

2025-04-26 Thread Igor Korot
David et al, On Fri, Apr 25, 2025 at 10:48 PM David G. Johnston wrote: > > On Friday, April 25, 2025, Igor Korot wrote: >> >> >> for( int i = 0; i < PQntuples( res ); i++ ) >> { >> auto temp1 = m_pimpl->m_myconv.from_bytes( PQgetvalue( >> res, i, 1 ) ); >>

Re: Changing default fillfactor for the whole database

2025-04-26 Thread David Rowley
On Sun, 27 Apr 2025 at 14:31, Marcelo Fernandes wrote: > I have a scenario where virtually all user tables in the database will need to > have a lower fill factor. > Does this make sense? Have I missed something about being able to change this > on a database level? I suspect that it's possible

Re: Changing default fillfactor for the whole database

2025-04-26 Thread Christophe Pettus
> On Apr 26, 2025, at 19:31, Marcelo Fernandes wrote: > Does this make sense? Have I missed something about being able to change this > on a database level? You haven't missed anything; there's no setting that controls the default for fillfactor. Everyone's use-case is different, of course,

Changing default fillfactor for the whole database

2025-04-26 Thread Marcelo Fernandes
Hi there, I have a scenario where virtually all user tables in the database will need to have a lower fill factor. It would have been handy to have a way to set this default, but as of now, I don't think the default can be changed. I have looked at `share/postgresql.conf.sample` file, and couldn

Re: How to get the data from the query

2025-04-26 Thread Igor Korot
Running this query: draft=# SELECT DISTINCT column_name, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_precision_radix, numeric_scale, is_nullabl e, column_default, ordinal_position, CASE WHEN column_name IN (SELECT ccu.column_name FROM information_schema.

Re: How to get the data from the query

2025-04-26 Thread Igor Korot
Now this query still works: [code] draft=# SELECT DISTINCT column_name, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_precision_radix, numeric_scale, is_nullabl e, column_default, ordinal_position FROM information_schema.columns WHERE table_name='leagues'

Re: How to get the data from the query

2025-04-26 Thread Igor Korot
Hi, David, On Sat, Apr 26, 2025 at 8:06 PM David G. Johnston wrote: > > On Saturday, April 26, 2025, Igor Korot wrote: >> >> but the size comes out "" (empty) >> > > What is the value you are expecting? Expecting to have "100". What is the minimal table definition (i.e., a one or few column

How to get the data from the query

2025-04-26 Thread David G. Johnston
On Saturday, April 26, 2025, Igor Korot wrote: > but the size comes out "" (empty) > > What is the value you are expecting? What is the minimal table definition (i.e., a one or few column table) that would produce this expected value? What does psql show if you use it to output the query against

How to get the data from the query

2025-04-26 Thread Igor Korot
Hi, ALL, [code] std::wstring query2 = L"SELECT DISTINCT column_name, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_precision_radix, numeric_scale, is_nullable, column_default, CASE WHEN column_name IN (SELECT ccu.column_name FROM information_schema.con

Re: How to properly fix memory leak

2025-04-26 Thread Laurenz Albe
On Fri, 2025-04-25 at 22:24 -0500, Igor Korot wrote: > Hi, ALL, > > [code] > auto res = PQexec( m_db, m_pimpl->m_myconv.to_bytes( query.c_str() > ).c_str() ); /* ask for binary results */ > if( PQresultStatus( res ) != PGRES_TUPLES_OK ) > { > auto err = m_pimpl->m_myconv.f

Re: How to properly fix memory leak

2025-04-26 Thread Igor Korot
Hi, Tom, On Sat, Apr 26, 2025 at 4:34 PM Tom Lane wrote: > Igor Korot writes: > auto temp1 = m_pimpl->m_myconv.from_bytes( PQgetvalue( > res, i, 1 ) ); > m_tablespaces.push_back( temp1 ); > > I would imagine that from_bytes()

Re: How to properly fix memory leak

2025-04-26 Thread Tom Lane
Igor Korot writes: auto temp1 = m_pimpl->m_myconv.from_bytes( PQgetvalue( res, i, 1 ) ); m_tablespaces.push_back( temp1 ); I would imagine that from_bytes() is producing a malloc'd string. Which part of this is responsible for

Re: How to properly fix memory leak

2025-04-26 Thread Igor Korot
Hi, Lauren’s, On Sat, Apr 26, 2025 at 3:30 PM Laurenz Albe wrote: > On Fri, 2025-04-25 at 22:24 -0500, Igor Korot wrote: > > Hi, ALL, > > > > [code] > > auto res = PQexec( m_db, m_pimpl->m_myconv.to_bytes( query.c_str() > > ).c_str() ); /* ask for binary results */ > > if( PQresultS