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

Re: [HACKERS] Data type removal

From: <geek+(at)cmu(dot)edu>
To: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Data type removal
Date: 1998-03-24 20:04:38
Message-ID: emacs-smtp-20243-13592-4566-337545@export.andrew.cmu.edu (view raw or flat)
Thread:
Lists: pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----

> From: dg(at)illustra(dot)com (David Gould)
> > Speaking of data type removal, I was wondering if there were a better
> > way to handle arrays of types.  From looking in the catalog, it
> > appears that for each type, there is also declared a similar type,
> > which is the array version.  It seems that arrays should be considered
> > more flags on a field, than a field type in themselves.  Does this
> > make sense to anybody else?
> 
> Is an array the same thing as a scalar?
Uhm, I don't believe so.

> What would be the benefit of making arrays "flags on a field" instead of
> a "field type in themselves". Seriously, how would this improve _anything_?

In particular, I was thinking of the PostgreSQL module for Python.  It
has a nice interface, but needs intimate knowledge of the data types.
Somehow, it seems to be excessively kludgy to have to have e.g. an
int4 type, and an int4[] type.  When I query a table, if one of the
fields is an array of integers, then I either want to know that it's
an array, or it's integer.  If the returned type is "array," then I
have to magically know that the array is filled with integers.  If
it's an integer, then I just have to recognize that it's actually a
series of integers.  With the current setup, there has to be separate
type handlers for char(2), char(2)[], int4, int4[], int2, int2[],
float8, float8[], etcetera.  I'd rather have handlers for the base
type, and an iterator that's used for arrays.

> What is the motivation for data type removal?

In this case, I don't want to *remove* the data type, just change the
identification method.  An array of int4 should really be recognized
as both (type)int4 and (type)array.  Urhm, since this is PostgreSQL, I
guess I'm arguing for type composition (how appropriate for an
object-relational database).

- -- 
=====================================================================
| JAVA must have been developed in the wilds of West Virginia.      |
| After all, why else would it support only single inheritance??    |
=====================================================================
| Finger geek(at)andrew(dot)cmu(dot)edu for my public key.                     |
=====================================================================

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQBVAwUBNRgR1YdzVnzma+gdAQFGVgH+PX4jvMZfhFK1ZzVdYuL844gCrg5ZleDt
T4x2b6TbOOqNGn7SZVQtpuCZXG7lSDFMNDRan2ft0OmE9ZlJ69ZpkA==
=q92I
-----END PGP SIGNATURE-----


In response to

pgsql-hackers by date

Next:From: Darren KingDate: 1998-03-24 20:16:21
Subject: Re: [HACKERS] Data type removal
Previous:From: David GouldDate: 1998-03-24 19:27:52
Subject: Re: [HACKERS] Data type removal

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