pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Andre Rothe <phosco@gmx.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Wrong column default values
Date: Sat, 19 Sep 2009 14:45:09 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.0909191442250.29622@leary.csoft.net> (raw)
In-Reply-To: <5562.1253304906@sss.pgh.pa.us>
References: <db420c9c-2345-4c06-add7-10ea404e4008@g6g2000vbr.googlegroups.com>
	<491f66a50909181307q147e92b4g58a6d5ef47cc0518@mail.gmail.com>
	<5562.1253304906@sss.pgh.pa.us>



On Fri, 18 Sep 2009, Tom Lane wrote:

> Indeed.  In 8.3 it seems that even if you try to set the default that
> way, the system will throw away the cast:

That's only true without a typmod.  Consider:

CREATE TEMP TABLE tt (a varchar default null, b varchar(10) default null, 
c timestamptz default null, d timestamptz(4) default null);

\d tt


  Column |            Type             |               Modifiers
--------+-----------------------------+----------------------------------------
  a      | character varying           |
  b      | character varying(10)       | default NULL::character varying
  c      | timestamp with time zone    |
  d      | timestamp(4) with time zone | default NULL::timestamp with time 
zone


Kris Jurka



view thread (9+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.0909191442250.29622@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.0909191442250.29622@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.0909191442250.29622@leary.csoft.net

 · 

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-jdbc@postgresql.org
  Cc: books@ejurka.com, tgl@sss.pgh.pa.us, pg@fastcrypt.com, phosco@gmx.de
  Subject: Re: Wrong column default values
  In-Reply-To: <alpine.BSO.2.00.0909191442250.29622@leary.csoft.net>
  References: <db420c9c-2345-4c06-add7-10ea404e4008@g6g2000vbr.googlegroups.com> <491f66a50909181307q147e92b4g58a6d5ef47cc0518@mail.gmail.com> <5562.1253304906@sss.pgh.pa.us> <alpine.BSO.2.00.0909191442250.29622@leary.csoft.net>

* 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