Re: jsonb on-disk size calculation

2023-07-31 Thread Junwang Zhao
convertJsonbObject convert JsonValue to Jsonb. Jsonb->vl_len_ is 4 byte JsonbContainer->header is 4 bytes JsonbContainer->children is an array of two elements, that's 8 bytes following the k/v part, 20 bytes In total 36 bytes. When Jsonb is stored to disk, I guess some conversion reduces the

Re: jsonb on-disk size calculation

2023-07-31 Thread Adrian Klaver
On 7/31/23 04:10, jian he wrote: hi. drop table x; create table x(js jsonb); insert into x select '{"Hello world":1}'::jsonb; select pg_column_size(js) from x;-- return 33. based on src/include/utils/jsonb.h The key and value part is 20 bytes (is it correct?), Jsonb->vl_len_  is 4 byte,

Re: Completely Removing PostgreSQL

2023-07-31 Thread Adrian Klaver
On 7/31/23 05:47, Amn Ojee Uw wrote: In my Debian 12, I have removed the following apps from my system by using the following commands: /*sudo apt-*//*get*//*–purge *//*remove*//*postgresql postgresql*//*-15*//*postgresql-client-common postgresql-common postgresql-contrib*//**//*sudo

Re: Completely Removing PostgreSQL

2023-07-31 Thread Ron
On 7/31/23 07:47, Amn Ojee Uw wrote: In my Debian 12, I have removed the following apps from my system by using the following commands: /*sudo apt-*//*get*//*–purge *//*remove*//*postgresql postgresql*//*-15*//*postgresql-client-common postgresql-common postgresql-contrib*//**//*sudo

Re: Completely Removing PostgreSQL

2023-07-31 Thread Alvaro Herrera
On 2023-Jul-31, Amn Ojee Uw wrote: > In my Debian 12, I have removed the following apps from my system by using > the following commands: > *dpkg -l | grep postgres* > rc  postgresql-12 12.15-1.pgdg120+1  amd64    The > World's Most Advanced Open Source Relational Database >

Completely Removing PostgreSQL

2023-07-31 Thread Amn Ojee Uw
In my Debian 12, I have removed the following apps from my system by using the following commands: /*sudo apt-*//*get*//*–purge *//*remove*//*postgresql postgresql*//*-15*//*postgresql-client-common postgresql-common postgresql-contrib*//**//*sudo apt-*//*get*//*–purge

Re: How to get an md5/sha256 hash of a really large object in psql?

2023-07-31 Thread Alex Shan
Great, thanks a lot! I will test it on my system. Myself, I tried to do it in C with libpq, but got stuck at reading a LO... On Sat, 29 Jul 2023 at 19:57, Erik Wienhold wrote: > > “SELECT md5(lo_get(loid));” doesnt work — “large object is too large”. > > > > Is there any other way to do it?

jsonb on-disk size calculation

2023-07-31 Thread jian he
hi. drop table x; create table x(js jsonb); insert into x select '{"Hello world":1}'::jsonb; select pg_column_size(js) from x; -- return 33. based on src/include/utils/jsonb.h The key and value part is 20 bytes (is it correct?), Jsonb->vl_len_ is 4 byte, JsonbContainer->header is 4 bytes.

Re: Upgrading

2023-07-31 Thread Wen Yi
You can see this document. https://www.postgresql.org/docs/current/pgupgrade.html Yours, WenYi ---Original--- From: "Amn Ojee Uw"

[Question]Can someone explain the context_freelists?

2023-07-31 Thread Wen Yi
In MemoryContext source code: /* context_freelists[0] is for default params, [1] for small params */ static AllocSetFreeList context_freelists[2] = { { 0, NULL }, { 0, NULL } }; I really don't know what this variable mean, can someone share me with your view? Thanks in advance!

AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

2023-07-31 Thread Priess Stefan
Tom, i followed your instructions exactly and put "--with-pgport" => 5433 in the config_default.pl and now it is working! Thanks! nexus / chili Stefan Priess Softwareentwicklung Tel: +49 6221 18079-10 E-Mail: stefan.pri...@nexus-chili.com NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2,

Re: Understanding pg_stat_io.evictions

2023-07-31 Thread Daniel Westermann (DWE)
>> postgres=# insert into t select i, md5(i::text), md5(i::text), md5(i::text) >> from generate_series(1,100) i; >.. >> client backend | 207 | normal >> client backend | 0 | vacuum >> >> Shouldn't these evictions show up under context blkwrite? The description in >> docs is:

AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

2023-07-31 Thread Priess Stefan
Good morning Tom, I tried adding pgport=> 5433, # --with-pgport= to the config_default.pl file. And $config->{pgport} = 5433; to the config.pl file. But the default port is still 5432... nexus / chili Stefan Priess Softwareentwicklung Tel: +49 6221 18079-10 E-Mail:

AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

2023-07-31 Thread Priess Stefan
Sorry, I meant that I need to change the default port from 5432 to 5433. nexus / chili Stefan Priess Softwareentwicklung Tel: +49 6221 18079-10 E-Mail: stefan.pri...@nexus-chili.com NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg www.nexus-chili.com Eingetragene