Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGnSL-0000Wc-Lx for pgsql-sql@arkaria.postgresql.org; Fri, 02 Jun 2017 14:21:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dGnSL-0005DQ-6a for pgsql-sql@arkaria.postgresql.org; Fri, 02 Jun 2017 14:21:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGnSK-0005Ay-HW for pgsql-sql@postgresql.org; Fri, 02 Jun 2017 14:21:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dGnSH-0001Q8-S6 for pgsql-sql@postgresql.org; Fri, 02 Jun 2017 14:21:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v52ELUeR012457; Fri, 2 Jun 2017 10:21:30 -0400 From: Tom Lane To: basuraspam - cc: pgsql-sql@postgresql.org Subject: Re: Database views metadata always nullable columns In-reply-to: References: Comments: In-reply-to basuraspam - message dated "Fri, 02 Jun 2017 16:11:25 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12455.1496413290.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 02 Jun 2017 10:21:30 -0400 Message-ID: <12456.1496413290@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org basuraspam - 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=3D# create table foo (f1 int, f2 int not null); CREATE TABLE regression=3D# select column_name, is_nullable from information_schema.colu= mns where table_name =3D 'foo'; column_name | is_nullable=20 -------------+------------- f1 | YES f2 | NO (2 rows) regression=3D# select attname,attnotnull from pg_attribute where attrelid = =3D 'foo'::regclass and attnum > 0; attname | attnotnull=20 ---------+------------ f1 | f f2 | 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 --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql