Postgresql 12 Beta2 Crashes for any Insert/Update

2019-06-27 Thread Mohsen Bande
i have a working database in PG 12 Beta 1. today i upgraded it to Beta 2.
everything goes fine and server is up and running. but trying to
INSERT/UPDATE anything, server crashes:

=# select id from user where id=0;
 id 
  0(1 row)=# UPDATE user SET is_deleted = true WHERE id = 0;
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

and the server log has nothing more:

2019-06-27 12:49:07.348  [16336] LOG:  server process (PID 17680) was
terminated by signal 11: Segmentation fault2019-06-27 12:49:07.348
[16336] DETAIL:  Failed process was running: UPDATE user SET
is_deleted = true WHERE id = 0;2019-06-27 12:49:07.348  [16336] LOG:
terminating any other active server processes2019-06-27 12:49:07.348
[16436] WARNING:  terminating connection because of crash of another
server process2019-06-27 12:49:07.348  [16436] DETAIL:  The postmaster
has commanded this server process to roll back the current transaction
and exit, because another server process exited abnormally and
possibly corrupted shared memory.2019-06-27 12:49:07.348  [16436]
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.2019-06-27 12:49:07.350  [17787] postgres@db_01
FATAL:  the database system is in recovery mode2019-06-27 12:49:07.363
 [16336] LOG:  all server processes terminated;
reinitializing2019-06-27 12:49:07.821  [17788] LOG:  database system
was interrupted; last known up at 2019-06-27 12:39:53 2019-06-27
12:49:07.858  [17788] LOG:  database system was not properly shut
down; automatic recovery in progress2019-06-27 12:49:07.868  [17788]
LOG:  redo starts at 4B2/5A000AF82019-06-27 12:49:07.868  [17788] LOG:
 invalid record length at 4B2/5A000B30: wanted 24, got 02019-06-27
12:49:07.868  [17788] LOG:  redo done at 4B2/5A000AF82019-06-27
12:49:08.063  [16336] LOG:  database system is ready to accept
connections


Re: Postgresql 12 Beta2 Crashes for any Insert/Update

2019-06-30 Thread Mohsen Bande
I've created a new database, and started to copy current data into it. it
seems to work.
it seems that the problem relates to upgrade process of database catalogs
from Beta1 to Beta2.
if the problem persists, it will investigate the stacktrace.
Thanks

On Thu, Jun 27, 2019 at 9:40 PM Peter Geoghegan  wrote:

> On Thu, Jun 27, 2019 at 1:28 AM Mohsen Bande 
> wrote:
> > i have a working database in PG 12 Beta 1. today i upgraded it to Beta
> 2. everything goes fine and server is up and running. but trying to
> INSERT/UPDATE anything, server crashes:
>
> Is it possible for you to send us a stacktrace?
>
>
> https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend
>
> Thanks
> --
> Peter Geoghegan
>


Re: Postgresql 12 Beta2 Crashes for any Insert/Update

2019-06-30 Thread Mohsen Bande
After Investigating deeper, I found the root cause.
Actually, the problem exists in certain tables, which i have created a
trigger on them calling a function from a custom dynamic extension.
the extension needs to rebuild (make && make install) against new PG
development header files.


On Sun, Jun 30, 2019 at 3:29 PM Mohsen Bande  wrote:

> I've created a new database, and started to copy current data into it. it
> seems to work.
> it seems that the problem relates to upgrade process of database catalogs
> from Beta1 to Beta2.
> if the problem persists, it will investigate the stacktrace.
> Thanks
>
> On Thu, Jun 27, 2019 at 9:40 PM Peter Geoghegan  wrote:
>
>> On Thu, Jun 27, 2019 at 1:28 AM Mohsen Bande 
>> wrote:
>> > i have a working database in PG 12 Beta 1. today i upgraded it to Beta
>> 2. everything goes fine and server is up and running. but trying to
>> INSERT/UPDATE anything, server crashes:
>>
>> Is it possible for you to send us a stacktrace?
>>
>>
>> https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend
>>
>> Thanks
>> --
>> Peter Geoghegan
>>
>


Strange Index sizes

2018-04-24 Thread Mohsen Bande
Hi all,
I have a user table with ~8M records, with different type of fields b-tree
indexed.
by investigating index sizes, i found two strange things:
1- all index sizes are almost the same, regardless of field type (boolean,
string, bigint)
2 - all of them are much bigger that my expectation, e.g. for a boolean
field, even after reindexing, the size is 217MB, so each record takes ~27
bytes.

could some one shed some light on this please? or refer any user oriented
documentation about index size estimations