Trying to update a box data type column

Поиск
Список
Период
Сортировка
От Yonatan Ben-Nes
Тема Trying to update a box data type column
Дата
Msg-id 447342A4.6000603@epoch.co.il
обсуждение исходный текст
Ответы Re: Trying to update a box data type column  (Michael Fuhr <mike@fuhr.org>)
Re: Trying to update a box data type column  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all,

I got the following table:

CREATE TABLE treecategory (
nleft INT4 NOT NULL,
nright INT4 NOT NULL,
box BOX NOT NULL
);

I can't figure out how I can update the box column using the values at
the nleft & nright columns.

For example if I try:
UPDATE treecategory SET box =
'('||"nleft"||','||"nright"||'),('||"nleft"||','||"nright"||')';
ERROR:  column "box" is of type box but expression is of type text
HINT:  You will need to rewrite or cast the expression.

And if I try to cast type text to box I get:
ERROR:  cannot cast type text to box

How can I solve this problem?

Thanks in advance,
    Ben-Nes Yonatan
    http://www.epoch.co.il

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Quering by Regular Expressions stored in table
Следующее
От: Rafal Pietrak
Дата:
Сообщение: Re: background triggers?