to_tsvector change behaviour - postgresql

I have migrated from RDS Aurora PostgreSQL 13.6 to Hetzner Managed DB PostgreSQL 13.8 and this query
SELECT to_tsvector('I am a heroe') ## to_tsquery('I & am & a & hero')
returns FALSE with RDS but TRUE with Hetzner
What could be the reason that bring this change ?
RDS uses pg_catalog.simple and Hetzner pg_catalog.english
But still on Hetzner SELECT to_tsvector('I am a hero') ## to_tsquery('simple', 'I & am & a & hero') returns false
Thanks

The answer must be that the parameter default_text_search_config is set to different languages in both databases. It is best to always explicitly specify the language, as in
to_tsvector('english', 'I am a heroe')

Related

Cloud SQL PostgresQL max_slot_wal_keep_size

I could not find any way to limit replication slot in Cloud SQL postgres flags (max_slot_wal_keep_size) ? Is there any way I can limit it ?

How to Full Text Search - Extension "tsvector" is not supported by Amazon RDS

I'm using Postgres v12.8 on AWS RDS. Installng TSVECTOR I get the error:
SQL Error [22023]: ERROR: Extension "tsvector" is not supported by Amazon RDS
Detail: Installing the extension "tsvector" failed, because it is not on the list of extensions supported by Amazon RDS.
Hint: Amazon RDS allows users with rds_superuser role to install supported extensions. See: SHOW rds.extensions;
The reason is because AWS RDS Postgres doesn't support the Extension:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport.Extensions
And it doesn't look like AWS RDS are going to add it: https://dba.stackexchange.com/a/111481/9328
So I have two questions,
Was TSVECTOR supported in the past in v9 (as per On AWS RDS Postgres, how to have dictionaries and unaccented full-text search?)?
If that's the case what are these people doing now as AWS have warned for over a year they would automatically upgrade v9 Postgres db's on the 18th Jan 2022?
What can I use to achieve Full Text Search in Postgres RDS? I don't want to have to spin up an EC2 or a Container for access to install TSVECTOR, surely there must be an alternative?
The documentation says RDS Postgres supports Full Text Search: https://aws.amazon.com/rds/postgresql/features/
Full Text Search Dictionaries – PostgreSQL supports Full Text Searching that provides the capability to identify natural-language documents that satisfy a query, and optionally to sort them by relevance to the query.
Perhaps Amazon did something strange, but in PostgreSQL there is no tsvector extension. tsvector is a built-in data type, and you don't have to install any extensions to use full-text search.

Oracle READ WRITE mode in postgres

I am migrating Oracle database to Postgres Aurora. There is one Oracle PL/SQL block which checks if the database is in read write open mode. Below is the query like:
Select open_mode into v_open_mode from v$database;
if v_open_mode = 'READ WRITE' then
-- perform some steps.
I want to know if we have any equivalent query in Postgres. Or even if I can know the postgres node is WRITE mode.
I am also open to get anything which is native to Aurora which show if the node is reader or writer.
I am not sure what the Oracle thing does, but I assume the closest thing would be to check if Postgres is in recovery mode using pg_is_in_recovery()
So something like:
if not pg_is_in_recovery() then
-- do some steps
end if;
That is from "stock" Postgres, I don't know if Amazon Aurora does anything different or provides other functions.

Aurora-PostgreSQL 12 config param related to CTE

I wanted to know if there are any Postgres config parameter settings available for CTEs in specific? The reason I am asking this is because we migrated a DB from AWS RDS Postgres to Aurora Postgres with the same major version (Postgres v12). Both the DB's have the same structure/indices/etc., however when we run the same CTE on Aurora, it runs very slow and shows very high IOPS v/s when we run it on RDS, it runs fast and no IOPS issue there. I am assuming that there might be some config setting which is different in RDS v/s Aurora which is causing the issue.
Any suggestions/recommendations?
Thanks

How to tell if data checksum feature is on in Postgres

Postgres 9.3 introduces a data checksum feature which can detect corruption in pages. Is there a way to query the database to determine if this is on?
Being hosted on a PaaS system, I don't have access to the actual server to check any configurations settings there. I also only have access to our database and not the main postgres database either. Is there a way to determine if this is on from a psql console only?
show data_checksums;
data_checksums
----------------
off
http://www.postgresql.org/docs/current/static/runtime-config-preset.html
You can use pg_controldata see if your postgresql cluster enable data_checksum.
if version=0 then your cluster disable the function.
And data_checksums parameter add by PostgreSQL 9.3.4, if your postgresql version small than that, you cannt select this guc parameter. you must check it by control file.
pg93#db-172-16-3-150-> pg_controldata |grep checksum
Data page checksum version: 0
From 9.4 on, you can try the following query:
select * from pg_settings where name ~ 'checksum';
https://paquier.xyz/postgresql-2/postgres-9-4-feature-highlight-data-checksum-switch-as-a-guc-parameter/