pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Bandy <bandy.chris@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6080: information_schema.columns.column_default contains NULL inconsistently
Date: Fri, 01 Jul 2011 23:35:21 -0400
Message-ID: <107.1309577721@sss.pgh.pa.us> (raw)
In-Reply-To: <201106282042.p5SKgVjo044969@wwwmaster.postgresql.org>
References: <201106282042.p5SKgVjo044969@wwwmaster.postgresql.org>

"Chris Bandy" <bandy.chris@gmail.com> writes:
> While using the information_schema to examine my tables, I found that
> "columns"."column_default" does not consistently represent the DEFAULT
> constraint/definition of a column.

> I would expect a column without a DEFAULT definition to return a null value,
> while a column with a DEFAULT definition would return the defined expression
> as a character value.

> In the following log, columns "a", "b" and "c" appear identical though their
> definitions differ.

I don't see anything to fix here.  The standard says that for a column
without any explicit default value, COLUMN_DEFAULT should be null.
But AFAICS there is room for implementation dependency in other cases.
In the particular cases you show here, PG recognizes some of them as
being equivalent to not having a default value, so for efficiency's sake
it converts them to that form.  I don't think we're bound to make every
such case work like that, though.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <107.1309577721@sss.pgh.pa.us>
Permalink:  ../107.1309577721@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/107.1309577721@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bandy.chris@gmail.com
  Subject: Re: BUG #6080: information_schema.columns.column_default contains NULL inconsistently
  In-Reply-To: <107.1309577721@sss.pgh.pa.us>
  References: <201106282042.p5SKgVjo044969@wwwmaster.postgresql.org> <107.1309577721@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox