Open RomanJaeger opened 3 months ago
Hi, Thank you for report. The error seems strange. The first thought was that your instance treats NULL text value as an empty string. Can you check it please? Try something like
postgres=# select 'a'||null::text||'b' is null;
?column?
----------
t
Check if it will be true or false.
Hi,
edb=# select 'a'||null::text||'b' is null;
?column?
----------
f
(1 row)
I get a false from this command.
It seems like a Oracle compatible mode in postgres. I'll try to find a way to avoid an error in such case.
Yes, that is correct. The database works with Oracle Objects and Procedures and is in compatible mode.
I'm sorry, I haven't access to such database, so I would ask you to test something for me in your environment. Would this return a NULL as a text value?
select format('%L', NULLIF('',''));
Here are the output.
edb=# select format('%L', NULLIF('',''));
format
--------
NULL
Hi, I found another issue, but I could not test it on a newer version. So perhabs it soveld then. I give you a short description. Please let me know, if I should open a new thread for this.
If I set the settings like SELECT set_server_size_sampling('local','23:00+03',interval '2 hour',interval '8 hour'); I get the error:
edb=# select * from profile.take_sample(); server | result | elapsed --------+-----------------------------------------------------------------------------+------------- local | operator does not exist: timestamp without time zone + time with time zone + | 00:00:00.03 | PL/pgSQL function take_sample(integer,boolean) line 51 at SQL statement + | PL/pgSQL function take_sample_subset(integer,integer) line 27 at assignment+ | SQL function "take_sample" statement 1 + |
---|
(1 row)
after I set the entry size_smp_wnd_start to null in the table servers. than it works again.
Sorry for long delay in discussion. The first part of the issue (invalid input syntax) likely will be fixed in upcoming 4.7. The second part (like the first one) does not produce any errors on PostgreSQL, so I need a test.. Could you please check something like
select now()::date + '23:00:00+03'::time with time zone;
No Problem. I'm glad to hear that the problem is solved in the new version.
If I put in your command I got this error:
In tested it in a postgres version 13. there it work.
I spoke with my contact by EDB. He is not absolutly sure, why ::date is not working. Can be something with the compatibility to Oracle, but if you change it to pg_catalog.date then it works.
select now()::pg_catalog.date + '23:00:00+03'::time with time zone;
On a EDB EPAS 16:
On a postgres as well. Tested on a version 13:
Thank you for detailed investigation, I'll include your solution in 4.7
Please check the 4.7 pre-release. Does it work on your environment?
Hi, I installed version 4.7 and get this error now.
edb=# SELECT * FROM profile.take_sample(); server | result | elapsed --------+--------------------------------------------------------------------------------------------------------------------+------------- local | syntax error at or near ")" + | 00:00:00.97 | while executing query on dblink connection named "server_connection" + | PL/pgSQL function collect_pg_stat_statements_stats(jsonb,integer,integer,integer) line 838 at FOR over SELECT rows+ | SQL statement "SELECT collect_pg_stat_statements_stats(server_properties, sserver_id, s_id, topn)" + | PL/pgSQL function take_sample(integer,boolean) line 624 at PERFORM + | PL/pgSQL function take_sample_subset(integer,integer) line 27 at assignment + | SQL function "take_sample" statement 1 + |
---|
(1 row)
Hi, is it the same system? I.e. EDB based Postgres 16, pgss 1.10?
Can you examine the server logs for exact failed statement executed over dblink? Looks strange - PG16 seems to be well-tested.
Hi, this is a EDB Version 16 and pgss 1.10.
Here are the output: 2024-09-25 11:37:03.794 CEST,"enterprisedb","idashval",2975268,"[local]",66f3d9be.2d6624,1,"idle in transaction",2024-09-25 11:37:02 CEST,36/3554,0,ERROR,42601,"syntax error at or near "")""",,,,,,"SELECT userid, dbid, toplevel, queryid, regexp_replace(query,$i$\s+$i$,$i$ $i$,$i$g$i$) AS query FROM public.pg_stat_statements(true) WHERE queryid IN ()",153,,"pg_profile","client backend",,0
Hello all,
I got the following error when I execute take_sample from Version 4.6
(1 row)
I downgraded to version 4.5 and it works now.
My set up is a EDB Postgres Database Version 16. User have superuser privileges. dblink version is 1.2, pg_stat_statements is 1.10 and plpgsql 1.0 .
Regards,
Roman