Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: int4 type mapping error in npgsql #24172

Closed
rkdrnfds opened this issue Mar 23, 2018 · 4 comments
Closed

sql: int4 type mapping error in npgsql #24172

rkdrnfds opened this issue Mar 23, 2018 · 4 comments
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@rkdrnfds
Copy link

When used cockroach db v2.0-beta.20180319,
it generates type mapping error as below when executed insertion query through Npgsql / EF Core

Npgsql.NpgsqlException (0x80004005): The PostgreSQL type 'int4', mapped to NpgsqlDbType 'Integer' isn't present in your database. You may need to install an extension or upgrade to a newer version.

cockroach db v2.0-alpha.20180129 does not generate those error and works well.

I created repository for repro so you can check it.
repro github

You can test it by manually creating database
with table as below

CREATE TABLE "Chunks" (
	"Id" INT NOT NULL DEFAULT unique_rowid(),
	CONSTRAINT "PK_Chunks" PRIMARY KEY ("Id" ASC),
	FAMILY "primary" ("Id")
)

and runnning program.

@jordanlewis
Copy link
Member

Hi @rkdrnfds,

I also don't understand this one. Like I said in #24173, we haven't changed our pg_type mapping recently so I don't expect this to have broken. We do provide the int4 type correctly in pg_type. Thanks for the repro, I'll try to take a look at this later today.

@jordanlewis
Copy link
Member

Hi @rkdrnfds,

I cannot reproduce this issue with your linked repository. As expected, the program successfully inserts the row into the database.

@knz knz added A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Apr 27, 2018
@knz knz changed the title int4 type mapping error in npgsql sql: int4 type mapping error in npgsql Apr 27, 2018
@knz knz mentioned this issue May 14, 2018
3 tasks
@bladefist
Copy link

@jordanlewis I reproduced this error, a couple times actually. The error message happens when you issue a query against a table that you do not have permission to query. It manifests itself as this error message, which sends the user off on the wrong path.

I've seen this happen a few times to me, and I always forget the solution and have to figure it out again. To my future self who will google this again some day, hope things are well! :)

@jordanlewis
Copy link
Member

This has been solved in 19.1.1. #24173.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

4 participants