Re: select few fields as a single field

From: Holger Krug <hkrug(at)rationalizer(dot)com>
To: Roman Gavrilov <romio(at)il(dot)aduva(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select few fields as a single field
Date: 2002-01-10 11:09:10
Message-ID: 20020110120910.A6669@dev12.rationalizer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rationalizer(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roman Gavrilov 2002-01-10 12:10:31 Re: select few fields as a single field
Previous Message Roman Gavrilov 2002-01-10 10:58:18 Re: select few fields as a single field