malloy icon indicating copy to clipboard operation
malloy copied to clipboard

Postgres connections do not error on non existent tables

Open mtoy-googly-moogly opened this issue 1 year ago • 3 comments

run: bigquery.table('nosuchproject.nosuchrable')-> {select: *}
run: postgres.table('nosuchschem.nosuchtable')-> {select: *}

The bigquery version of this errors, the postgres version is silent but deadly

mtoy-googly-moogly avatar Oct 24 '23 21:10 mtoy-googly-moogly

Fwiw, I couldn't get postgres.table to work on tables that do exist. I had to resort to using postgres.sql().

kylenesbit avatar Oct 25 '23 17:10 kylenesbit

@kylenesbit postgres.table() works great ... unless there are permission problems and the user you are logging in as can't read the information it uses out of the information_schema. In that case .sql() is probably a decent workaround.

If you have some other example of postgres.table() not working, we would appreciate some more information so we could fix that problem.

mtoy-googly-moogly avatar Nov 01 '23 20:11 mtoy-googly-moogly

Here is what i am using

source: configs is postgres.table("model.configs") extend {
}

run: configs -> {
    select: *
    limit: 1
}

This fails with error: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

When I switch the source to postgres.table("configs") I get this error: Default schema not yet supported in Postgres

When I switch the source to 'postgres.sql("SELECT * FROM configs")' it works.

The user should have access to the information_schema. If the user doesn't, it would be nice if that requirement was included in the error message.

kylenesbit avatar Nov 06 '23 16:11 kylenesbit