malloy
malloy copied to clipboard
Postgres connections do not error on non existent tables
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
Fwiw, I couldn't get postgres.table to work on tables that do exist. I had to resort to using postgres.sql().
@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.
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.