Sorry..

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Sorry..
Дата
Msg-id GNELIHDDFBOCMGBFGEFOAECDCDAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответы Re: Sorry..
Список pgsql-sql
Ignore previous half-completed email.

How do you get this to work in 7.2.1?

I'm creating a view of a table, but I'm trying to do something like
this:


create table t ( id integer not null, amount numeric(7,2)
);

create view v as select id as v_id,   'paid amount: ' || amount as v_comment from t
;

You get this:

ERROR:  Unable to identify an operator '||' for types 'unknown' and
'numeric'       You will have to retype this query using an explicit cast

None of these work:

CAST(amount AS text)
CAST(amount AS varchar)
CAST(amount AS char)
and this:
CAST(amount AS real) works, but if amount is 12.00, then you just get '12' -
which is not cool.

Any ideas?

Chris



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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Quick Question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Sorry..