Re: Trying to update a box data type column - Mailing list pgsql-general

From Tom Lane
Subject Re: Trying to update a box data type column
Date
Msg-id 16669.1148406041@sss.pgh.pa.us
Whole thread Raw
In response to Trying to update a box data type column  (Yonatan Ben-Nes <yonatan@epoch.co.il>)
List pgsql-general
Yonatan Ben-Nes <yonatan@epoch.co.il> writes:
> I can't figure out how I can update the box column using the values at
> the nleft & nright columns.

Use the provided constructor functions:

regression=# select box(point(1,2),point(3,4));
     box
-------------
 (3,4),(1,2)
(1 row)

As a general rule, converting something to text and back is not the way
to convert data from one type to another; if it's not a really
outlandish conversion, there'll be a function or cast to help.

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Trying to update a box data type column
Next
From: "Dawid Kuroczko"
Date:
Subject: Re: background triggers?