Re: how to insert values into complex type field

From: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
To: windwxc(at)sina(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to insert values into complex type field
Date: 2008-04-04 12:16:53
Message-ID: 20080404121653.GA12061@nic.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Apr 04, 2008 at 04:32:36PM +0800,
windwxc(at)sina(dot)com <windwxc(at)sina(dot)com> wrote
a message of 74 lines which said:

> INSERT INTO attribute2005 VALUES(1,(23,'ee','ttt',('2005-01-01','2005-12-31')));

And why did you not post the error message? Because it is very clear:

ERROR: malformed record literal: "ttt"
DETAIL: Missing left parenthesis.

Indeed, attributetype has no column for this 'ttt' value. The correct
INSERT is:

INSERT INTO attribute2005 VALUES(1,(23,'ee',('2005-01-01','2005-12-31')));

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aidan Van Dyk 2008-04-04 13:15:31 Re: modules
Previous Message Andrea 2008-04-04 10:45:34 Newby Help needed