I have the following part of Liquibase changeset that creates index on a hstore column.
CREATE INDEX index_name ON ${schemaName}.table_name ((attributes->'dataset'));
When I run it I get the following error:
... 7 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: public.hstore -> unknown
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 109
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
The hstore extensions is installed as I've checked it.
The engine version is 12.5 on AWS RDS instance.
This was written for postgres 9.6, so I believe it should work without any issues when it comes to combatibility.
Jdbc driver for postgres is in version of 42.2.18
Related
My Postgres DB version is 13.5.
When I run -
SELECT pg_column_size(jdoc) FROM dataingest.refresh limit 10;
I am getting result as expected.
pg_column_size|
--------------+
2523|
2530|
But when I run -
SELECT pg_column_compression(jdoc) FROM dataingest.refresh limit 2;
I am facing below error.
SQL Error [42883]: ERROR: function pg_column_compression(jsonb) does
not exist Hint: No function matches the given name and argument
types. You might need to add explicit type casts.
What could be issue and how to fix it.
pg_column_compression was introduced in Postgres 14, so it's not available in Postgres 13 which is the version you are using.
The only way to "fix" this is to upgrade to Postgres 14 or 15
Postgres 12, Postgis 3
Two triggers are originally defined w/ the criteria
WHEN (OLD.geom IS DISTINCT FROM NEW.geom). The geom column is of type geometry.
This caused issues when pg_restore-ing the database due to the geometry operator for equals not being available:
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 10233; 2620 673186 TRIGGER lines the_trigger_name geo
pg_restore: error: could not execute query: ERROR: operator is not unique: public.geometry = public.geometry
LINE 1: ...public.lines FOR EACH ROW WHEN ((old.geom IS DISTINC...
^
HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
Command was: CREATE TRIGGER the_trigger_name AFTER UPDATE ON public.lines FOR EACH ROW WHEN ((old.geom IS DISTINCT FROM new.geom)) EXECUTE FUNCTION public.the_function_name();
The backup database uses postgis 3.0.0
We load it in two different ways:
in one environment (postgis 3.0.1), we use a a database dump in the plain text (default) format (pg_dump -F p), and load it up by just executing the plaintext file, like psql -f /my/file.sql
this reported the error, but the database load still works
in another environment (postgis 3.0.2), we use a a database dump in the custom format (pg_dump -F custom) and load it up by running pg_restore --single-transaction < “$DB_FILE”
this reported the error, and failed
Adding a ::geometry cast on OLD/NEW geom fixes this issue. Why is pg unable to determine the equality operator in certain contexts (without type casts)?
I am using PostgreSQL DB hosted on AWS. I am trying to use fuzzy logic, enabled its extension successfully.
But running the fussy match Query gives me an exception. Also verified, the extension is already enabled but still, Query failed.
**Query used to enable extension** - CREATE EXTENSION pg_trgm;
**DB version details** - PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16), 64-bit
**Query for fuzzy match** - SELECT first_name FROM contact WHERE first_name % 'Eve' LIMIT 10;
**Error message -** SQL Error [42883]: ERROR: operator does not exist: character varying % unknown
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 49
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying % unknown
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 49
I recently upgraded my Amazon PostgreSQL RDS to version 10.3 but while fetching the projections I am getting error:
ERROR: transform_geom: couldn't parse proj4 output string: '3857': projection not named
CONTEXT: SQL function "st_transform" statement 1
Same records i am able to fetch prior to version 9.5.xx
My PostGIS version is 2.4.2 which is compatible to RDS intance.
I perhaps faced the same problem after upgrading from postgis 2.2 to 2.3, some of my queries did no work anymore.
Old-query:
SELECT ST_X(ST_TRANSFORM(ST_SETSRID(ST_MAKEPOINT($1,$2),$3),$4));
query-params $1...$4:
602628,6663367,3857,3857
error message:
"transform_geom: couldn't parse proj4 output string: '3857': projection not named"
Reason:
ST_TRANSFORM comes in multiple flavours, two of them:
public.st_transform(geometry, integer)
public.st_transform(geometry, text)
Latter one, I assume new in postgis 2.3, caused my problem, because $4 (3857) was regarded as (proj4-) string and not as (SRID-) integer.
Workaround in my case: type-hint for param $4
SELECT ST_X(ST_TRANSFORM(ST_SETSRID(ST_MAKEPOINT($1,$2),$3),$4::int));
I am trying to generate a Liquibase change log by running the command generateChangeLog, but I get the following error:
Starting Liquibase at Fri, 20 Apr 2018 14:26:14 GMT (version 3.6.1
built at 2018-04-11 08:41:04)
Unexpected error running Liquibase:
liquibase.exception.DatabaseException:
com.ibm.as400.access.AS400JDBCSQLSyntaxErrorException: [SQL0204]
REFERENCES in SYSCAT type *FILE not found.
liquibase.exception.LiquibaseException:
liquibase.command.CommandExecutionException:
liquibase.exception.DatabaseException:
liquibase.exception.DatabaseException:
com.ibm.as400.access.AS400JDBCSQLSyntaxErrorException: [SQL0204]
REFERENCES in SYSCAT type *FILE not found.
at
liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog
(CommandLineUtils.java:279)
at liquibase.integration.commandline.Main.doMigration(Main.java:1043)
at liquibase.integration.commandline.Main.run(Main.java:191)
at liquibase.integration.commandline.Main.main(Main.java:129)
My environment is:
DB2 UDB for AS/400 version 07.01.0000 V7R1m0
AS/400 Toolbox for Java JDBC Driver 10.2
liquibase 3.6.1
Java 8
Maven 3.3.3
syscat.references is not available on Db2 for i. Actually Db2 for i doesn't have a schema named SYSCAT at all.
qsys2.syscstdep seems to be the closest match...
INFORMATION_SCHEMA is the ANSI & ISO standard name for the DB catalog schema. On Db2 for i, it is an alias for QSYS2.
Edit
From the comment by #jmarkmurphy on the OP, it appears there's an Db2 for i Liquibase extension. I don't know for sure, but I'd suspect that installing that would redirect the query to the correct Db2 for i schema & table.