Re: select few fields as a single field

Поиск
Список
Период
Сортировка
От Holger Krug
Тема Re: select few fields as a single field
Дата
Msg-id 20020110120910.A6669@dev12.rationalizer.com
обсуждение исходный текст
Ответ на Re: select few fields as a single field  (Roman Gavrilov <romio@il.aduva.com>)
Список pgsql-general
On Thu, Jan 10, 2002 at 12:58:18PM +0200, Roman Gavrilov wrote:
> Thank you for your response.
> Yes I know that i can make a function.
> Is there a way to do this transparently I want to treat this function as a
> field in the table.

No.

> The reason why i want to do that is because i have a class that has generic
> method to retrieve data.
> It receives list of field names and returns their values from the table.
> If I want to implement the function method i will have to modify the class
> method and will have to treat specially the
> retrieve fullname thing.

OK. But why not views ? That's exactly the use case where views should
be used in PostgreSQL. Using views you need not modify anything in
your class.

Alternative solution:

Change your class (if possible) to have the members name, version,
release and add a method getFullName() to the class. (I would never
do this but use views.)

--
Holger Krug
hkrug@rationalizer.com

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

Предыдущее
От: Roman Gavrilov
Дата:
Сообщение: Re: select few fields as a single field
Следующее
От: "Alaric B. Snell"
Дата:
Сообщение: Re: Query planner isn't using my indices