Re: select few fields as a single field - Mailing list pgsql-general

From Holger Krug
Subject Re: select few fields as a single field
Date
Msg-id 20020110120910.A6669@dev12.rationalizer.com
Whole thread Raw
In response to Re: select few fields as a single field  (Roman Gavrilov <romio@il.aduva.com>)
List 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 by date:

Previous
From: Roman Gavrilov
Date:
Subject: Re: select few fields as a single field
Next
From: "Alaric B. Snell"
Date:
Subject: Re: Query planner isn't using my indices