Re: datatype preceded by underscore creates array

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: datatype preceded by underscore creates array
Date: 2006-10-16 20:43:56
Message-ID: 8C5B026B51B6854CBE88121DBF097A8651DBC0@ehost010-33.exch010.intermedia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Mon, Oct 16, 2006 at 01:16:34PM -0700, George Pavlov wrote:
> > Hmm, I am not sure I particularly like this behavior or the
> > "ignore it"
> > advice. Suppose someone makes a typo in his/her table
> > definition: meant
> > to create an int4 column but accidentally typed an underscore. You'd
> > expect the statement to fail. Instead it doesn't fail but creates an
> > unexpected datatype for the column. If undescore is a
> > purposeful (rather
> > than an accidental) SQL standard extension one would expect
> > it to be (a) documented in some place like
> >
> > http://www.postgresql.org/docs/8.1/static/arrays.html#AEN5584, and
(b)
> > behaving more consistently (if _foo is a synonym for foo[] then all
> > variations of "foo" should support it).
>
> Hmm, if someone typos to get "int8" instead of "int4" they get the
> wrong datatype too, I don't know if that's an argument. The reason is
> that all types need to have an identifier. I suppose they could be
> called "pg_internal_array_type_for_int4", but for historical reasons
> it's just _int4.

yes, but int8 is a clearly documented while preceding certain "magic"
datatype names with underscores is not. i really don't have much of a
problem with this, but little things like this contribute to people
coming from other DBMSs developing opinions that "this open-source stuff
does weird, undocumented things" (not that commercial DBMSs don't do
weird stuff :). sorry to belabor a minor point.

george

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jorge Godoy 2006-10-16 20:45:51 Re: RES: Dates rejected
Previous Message Martijn van Oosterhout 2006-10-16 20:33:53 Re: datatype preceded by underscore creates array