Effects of not using NOT NULL - Mailing list pgsql-general

From Matthew V." <
Subject Effects of not using NOT NULL
Date
Msg-id etIv9.33301$iV1.3123@nwrddc02.gnilink.net
Whole thread Raw
Responses Re: Effects of not using NOT NULL
List pgsql-general
In DB2, when tables are created without using NOT NULL on columns, an
extra byte is added to each record in the column as a NULL indicator flag.
 This byte is part of the data, and it exists for every occurrence of that
field.  (I think it's a byte--it might be two).  This has the tendency to
add a lot of space to the tablespace for maintaining the NULL indicator,
and also imposes a requirement on embedded SQL applications of using a
NULL indicator field when selecting/updating such fields.  E.g.:

    EXEC SQL
        SELECT nullableField
        INTO   :variabe:nullIndicator
        FROM   table
    END-EXEC.

where nullIndicator is defined as a binary field (short, PIC S9(04) COMP,
etc) in the host language.  A seperate variable must be used for each
nullable field being selected.

Does Postgresql include a similar NULL indicator flag on nullable fields,
and if so, how big is it?  Also, does that impose the restriction on
embedded SQL of having a variable in which to store the null indicator
flag?

--
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...

pgsql-general by date:

Previous
From: "Greg Patnude"
Date:
Subject: Database replication... - Mission Critical DBMS's -- Taking postgreSQL to the Enterprise Computing level...
Next
From: derek@spencerogne.com (Derek Spencer)
Date:
Subject: maximum number of triggers on a table?