Re: [SQL] Database views metadata always nullable columns - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Database views metadata always nullable columns
Date
Msg-id 12456.1496413290@sss.pgh.pa.us
Whole thread Raw
In response to [SQL] Database views metadata always nullable columns  (basuraspam - <basuraspam0@gmail.com>)
Responses Re: [SQL] Database views metadata always nullable columns
List pgsql-sql
basuraspam - <basuraspam0@gmail.com> writes:
>    Doing some automatic metadata parsing job against postgresql schema I
> just find that database views always shown all its column as nullable, it
> doesn't matter what are the constraints in the original table columns used
> as source to create the view.
> I just checked it against infomation_schema and pg_attribute with the same
> result.

regression=# create table foo (f1 int, f2 int not null);
CREATE TABLE
regression=# select column_name, is_nullable from information_schema.columns where table_name = 'foo';column_name |
is_nullable 
-------------+-------------f1          | YESf2          | NO
(2 rows)

regression=# select attname,attnotnull from pg_attribute where attrelid = 'foo'::regclass and attnum > 0;attname |
attnotnull 
---------+------------f1      | ff2      | t
(2 rows)

So I don't see anything particularly broken here.  Maybe you should
provide some concrete examples rather than making sweeping claims.
        regards, tom lane



pgsql-sql by date:

Previous
From: basuraspam -
Date:
Subject: [SQL] Database views metadata always nullable columns
Next
From: basuraspam -
Date:
Subject: Re: [SQL] Database views metadata always nullable columns