-
Notifications
You must be signed in to change notification settings - Fork 877
Description
Steps to reproduce
- create database something;
- create extension postgis;
- create tablespace
- alter database set tablespace new
- alter database set tablespace pg_default;
- Launch project that connects to this database.
The issue
Exception message:
Npgsql.NpgsqlException (0x80004005): The NpgsqlDbType 'Geography' isn't present in your database. You may need to install an extension or upgrade to a newer version.
Stack trace:
at Npgsql.TypeMapping.TypeMapper.ResolveByNpgsqlDbType(NpgsqlDbType npgsqlDbType)
at Npgsql.NpgsqlParameter.ResolveHandler(TypeMapper typeMapper)
at Npgsql.NpgsqlBinaryImporter.Write[T](T value, NpgsqlParameter param, Boolean async, CancellationToken cancellationToken)
Further technical details
Npgsql version: 7.0.0
PostgreSQL version: 15.1 with postgis
Operating system: Windows 11
Other details about my project setup:
The code that triggers this is a script which uses the binary importer to bulk load some data. This was working fine before, the only thing that changed between it working and not working is changing the tablespace then changing it back to pg_default.
\dT geography:
List of data types
+--------+-----------+------------------------------------------------------------------------------------------------------+
| Schema | Name | Description |
+--------+-----------+------------------------------------------------------------------------------------------------------+
| public | geography | postgis type: The type representing spatial features with geodetic (ellipsoidal) coordinate systems. |
+--------+-----------+------------------------------------------------------------------------------------------------------+
(1 row)
I'm confused, I have no idea what is wrong or why/how did this break.
CREATE EXTENSION postgis:
ERROR: 42710: extension "postgis" already exists
LOCATION: CreateExtension, extension.c:1729
Time: 2.002 ms
alter extension postgis update;
NOTICE: 00000: version "3.3.2" of extension "postgis" is already installed
LOCATION: ExecAlterExtensionStmt, extension.c:3006
ALTER EXTENSION
I feel like I'm getting gaslit. If I try to drop the extension, it says objects depend on it. It's definitely 100% there.
The connection string in my app was not touched.