Skip site navigation (1) Skip section navigation (2)

Re: Bug #513: union all changes char(3) column definition

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>, stiening(at)cannon(dot)astro(dot)umass(dot)edu, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #513: union all changes char(3) column definition
Date: 2001-11-22 03:10:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-hackers
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Tom Lane writes:
> >> CREATE TABLE AS cannot be expected to be able to extract a suitable
> >> typmod from complex expressions.
> > I don't think that would be entirely unreasonable.
> Well, it might not be completely impossible, but I think it's well on
> the far side of unreasonable.  For *every operator* that produces a
> result of any of the typmod-using types, we'd have to maintain an
> auxiliary bit of code that can predict the result typmod.  That's
> a lot of code, and when you start considering user-defined functions
> it gets worse.  And all for what?  Not to do anything useful, but only
> to *eliminate* functionality.  Perhaps char without typmod is
> unnecessary (since it reduces to text), but numeric without typmod seems
> highly useful to me.
> Strikes me as a very large amount of work to go in the wrong
> direction...

Added to TODO:

	* CREATE TABLE AS can not determine column lengths from expressions

Seems it should be documented.  Do we throw an error in these cases?

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2001-11-22 03:11:12
Subject: Re: rename index?
Previous:From: Bruce MomjianDate: 2001-11-22 02:43:45
Subject: Re: rename index?

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-11-22 03:51:04
Subject: Re: Bug #513: union all changes char(3) column definition
Previous:From: Stephan SzaboDate: 2001-11-21 20:50:51
Subject: Re: Bug #518: SERIAL type value not seen in FOREIGN KEY

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group