empty arrays

From: <floyds(at)4peakstech(dot)com>
To: "Pgsql-Sql" <pgsql-sql(at)postgresql(dot)org>
Subject: empty arrays
Date: 2002-12-30 17:40:44
Message-ID: NDBBKEGJICMIMJHJEBCOKENLFOAA.floyds@4peakstech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


using: psql (PostgreSQL) 7.2.1

why does an empty array return an array of length 1 rather than array of
length 0? one would think that the results below would have returned { }
instead of {0}.

simple test using psql:

# create table test_table ( test_column integer[] );
CREATE
# insert into test_table (test_column) values ( '{ }' );
INSERT 43475 1
# select * from test_table;

test_column
------------
{0}
(1 row)

i want to be able to store a zero-length array field in the database. how do
i specify this with sql?

Regards,

Floyd Shackelford
4 Peaks Technology Group, Inc.
VOICE: 334.735.9428
FAX: 916.404.7125
EMAIL: FloydS(at)4PeaksTech(dot)com
ICQ #: 161371538

Shackelford Motto: ACTA NON VERBA - Actions, not words

Alabama StateMotto: AUDEMUS JURA NOSTRA DEFENDERE - We Dare Defend Our
Rights

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Davies 2002-12-31 15:46:13 Slow self-join on a 100 million record table
Previous Message Thorsten Meinl 2002-12-30 17:28:58 Re: batch example