Re: Is it possible to return custom type as proper ROW?

Поиск
Список
Период
Сортировка
От Uwe C. Schroeder
Тема Re: Is it possible to return custom type as proper ROW?
Дата
Msg-id 200610111105.48913.uwe@oss4u.com
обсуждение исходный текст
Ответ на Re: Is it possible to return custom type as proper ROW?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: Is it possible to return custom type as proper ROW?  ("Merlin Moncure" <mmoncure@gmail.com>)
Re: Is it possible to return custom type as proper ROW?  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
On Wednesday 11 October 2006 10:42, A. Kretschmer wrote:
> am  Wed, dem 11.10.2006, um 12:56:51 -0400 mailte Tom Lane folgendes:
> > Andreas Kretschmer <akretschmer@spamfence.net> writes:
> > > Joe Kramer <cckramer@gmail.com> schrieb:
> > >> I want to get:
> > >> item_id   |   last_update
> > >> -------------------------------------
> > >> 32         |  1234-12-12 12:12:12
> > >
> > > Untested:
> > > SELECT item_id, last_update from public.new_item(3,2);
> >
> > Or just
> >     SELECT * FROM public.new_item(3,2);
>
> Yes, but i have learned, that 'SELECT * ...' is evil...

Well, "SELECT *" is only evil if your application relies on a specific column
order to function. The moment you change the table layout and you're using
"select *" your application will cease functioning.
My app uses tons of select *, but then I wrote an object mapper that queries
the information schema at startup - so it's aware of table changes and
adjusts accordingly.

Uwe


--
Open Source Solutions 4U, LLC    1618 Kelly St
Phone:  +1 707 568 3056        Santa Rosa, CA 95401
Cell:   +1 650 302 2405        United States
Fax:    +1 707 568 6416

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

Предыдущее
От: "Karen Hill"
Дата:
Сообщение: Re: Find out the number of rows returned by refcursor?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Find out the number of rows returned by refcursor?