Skip to content

specs2 null check fails with PostgreSQL views #613

Description

@phile314-fh

The specs2 unit tests falsely expects all columns to be nullable if the query uses a view. The root cause seems to be incorrect metadata from PostgreSQL. PostgreSQL reports all view columns as nullable even for trivial views:

create table test (id int not null);
create view test_view as select * from test;

\d test
Table "public.test"
 Column |  Type   | Modifiers 
--------+---------+-----------
 id     | integer | not null

viskar=> \d test_view
View "public.test_view"
 Column |  Type   | Modifiers 
--------+---------+-----------
 id     | integer |

Related StackOverflow question: https://stackoverflow.com/questions/17301323/why-are-my-views-columns-nullable

Maybe a simple solution would be to be able to manually disable the null check for a query but keeping the other type mapping validation features enabled?

Metadata

Metadata

Assignees

No one assigned

    Labels

    JDBC driver issueIssue caused by a JDBC driver misbehaving

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions