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

NRE in Postgres Table.readExistingAsync #95

Open
migajek opened this issue Jul 26, 2023 · 3 comments
Open

NRE in Postgres Table.readExistingAsync #95

migajek opened this issue Jul 26, 2023 · 3 comments

Comments

@migajek
Copy link

migajek commented Jul 26, 2023

using Marten 6.0.5, running Storage.Database.WriteMigrationFileAsync(fn);

  1. on the first run, it generates considerably large script that creates tables for documents among others
  2. on the subsequent run it fails with NRE as shown below:

image

the schema for this table is a regular Marten schema (as taken from the first migration script)

CREATE TABLE public.mt_doc_accesskeymodel (
    id                  uuid                        NOT NULL,
    data                jsonb                       NOT NULL,
    mt_last_modified    timestamp with time zone    NULL DEFAULT (transaction_timestamp()),
    mt_version          uuid                        NOT NULL DEFAULT (md5(random()::text || clock_timestamp()::text)::uuid),
    mt_dotnet_type      varchar                     NULL,
CONSTRAINT pkey_mt_doc_accesskeymodel_id PRIMARY KEY (id)
);
@migajek
Copy link
Author

migajek commented Jul 26, 2023

strange, but I altered the db user with "superadmin" and it doesn't occur anymore at this point

@jeremydmiller
Copy link
Member

Not strange, Postresql quiet fails accessing the schema metadata when you don't have the prerequisite rights. Not a new problem:(

@gfoidl
Copy link
Contributor

gfoidl commented Dec 17, 2023

Should there be a different exception be thrown?
I mean a NRE alludes a bug (here within Weasel) which isn't the case. Maybe wrap the NRE in custom exception that has a hint about PostgreSQL's behavior with missing rights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants