Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'

2020-04-28 Thread Matthias Apitz


I've added the proposed log line to the server code in 
src/backend/libpq/pqcomm.c
and restarted the server with this. In the log file 
/data/postgresql11/data/serverlog
are other messages about length of packages, like:

2020-04-28 09:49:49.877 CEST [16229] LOG:  invalid length of startup packet
2020-04-28 09:49:50.117 CEST [16231] LOG:  invalid length of startup packet

They're coming from:

grep 'invalid length of startup packet' src/backend/*/*.c
src/backend/postmaster/postmaster.c: 
errmsg("invalid length of startup packet")));

I will change the code there to to get the 'len' printed with the
message

...
if (len < (int32) sizeof(ProtocolVersion) ||
len > MAX_STARTUP_PACKET_LENGTH)
{
ereport(COMMERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
 errmsg("invalid length %d of startup packet", 
len)));
return STATUS_ERROR;
}

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!




GIN Expression Indexes

2020-04-28 Thread Taylor Sarrafian
Hi friends!

We tried to index an array function like this:

  CREATE INDEX my_arr_index ON my_table USING GIN ( my_arr_func( my_col ) )

But the planner can’t seem to figure out how to use the index with any query! 
It doesn’t work with any array operators.

  SELECT * FROM my_table WHERE ARRAY[ 123 ]::INT[] && my_arr_func( my_col )

Even weirder, an empty array correctly uses the index:

  SELECT * FROM my_table WHERE ARRAY[]::INT[] && my_arr_func( my_col )

Is there any way to coerce Postgres into using this index? Thanks!

ts

Re: GIN Expression Indexes

2020-04-28 Thread Adrian Klaver

On 4/28/20 1:58 PM, Taylor Sarrafian wrote:

Hi friends!

We tried to index an array function like this:

   CREATE INDEX my_arr_index ON my_table USING GIN ( my_arr_func( my_col ) )

But the planner can’t seem to figure out how to use the index with any 
query! It doesn’t work with any array operators.


   SELECT * FROM my_table WHERE ARRAY[ 123 ]::INT[] && my_arr_func( my_col )

Even weirder, an empty array correctly uses the index:

   SELECT * FROM my_table WHERE ARRAY[]::INT[] && my_arr_func( my_col )

Is there any way to coerce Postgres into using this index? Thanks!


Well without:

1) Table schema.

2) EXPLAIN ANALYZE for the query(s)

there is really not information to formulate an answer.



ts



--
Adrian Klaver
adrian.kla...@aklaver.com