pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chaotic Inceptions <chaoticinc@cyberus.ca>
To: pgsql-sql@postgreSQL.org
To: pgsql-bugs@postgreSQL.org
Subject: Arrays of composites, bug or usage?
Date: Sun, 14 Nov 1999 16:03:04 -0500 (EST)
Message-ID: <199911142103.QAA27861@cyberus.ca> (raw)

Hello,

I have a question on array usage. I created an array with the following
commands:

CREATE TABLE file (
    path                varchar(255);
    description         varchar(255);
);

CREATE TYPE file_array (
    INPUT = array_in,
    OUTPUT = array_out
    INTERNALLENGTH = VARIABLE,
    ELEMENT = file
);

CREATE TABLE media (
    media_type          char,
    media_list          file_array
);

First of all, is the above legal and if not, is there a way to do it?
Is this an array of composite types or is that something else?

When I attempt to insert values into the array with the following command, 

INSERT INTO media (media_type,media_list)
VALUES ('C', '{""/usr/doc/list1","This is the description"",
""/usr/doc/list2","Another description""}');

the INSERT succeeds, but a subsequent select reveals the following:

SELECT * FROM media;

media_type|media_list
----------+----------
C         |{0,0}
(1 row)

Is this a problem with levels of indirection in that I am looking at a
pointer or something? Have I completed the insert incorrectly or is the
parser unable to
handle this?

I would be happy to document this for everyone once I understand it.

Jason Kania
chaoticinc@cyberus.ca




Message-ID: <199911142103.QAA27861@cyberus.ca>
Permalink:  ../199911142103.QAA27861@cyberus.ca/
Also on:    postgresql.org/message-id/199911142103.QAA27861@cyberus.ca

 · 

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-sql@postgresql.org
  Cc: chaoticinc@cyberus.ca, pgsql-bugs@postgreSQL.org
  Subject: Re: Arrays of composites, bug or usage?
  In-Reply-To: <199911142103.QAA27861@cyberus.ca>
  References: <199911142103.QAA27861@cyberus.ca>

* 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