Re: record datatype comparisons

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: record datatype comparisons
Дата
Msg-id 20061101142833.GA25856@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Re: record datatype comparisons  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
Ответы Re: record datatype comparisons
Список pgsql-sql
On Tue, Oct 31, 2006 at 11:45:00PM +0200, Volkan YAZICI wrote:
> > 
> > Note the column headers.  They're differently shaped.  Because
> > pseudotype record doesn't have a shape, equality doesn't make sense,
> > so you need two shapes that are already identical, so they can use
> > the matching rules for that.
> 
> Can you be more verbose please? I couldn't understand what you mean with
> "shape". 

It's an analogy, really.  The datatype numeric() for instance, is
determined.  Because it's determined, you can have determinate rules
for comparing one to another.

But the pseudotype record doesn't work that way.  It can accept
whatever you put in there, which is why you can define a variable as
type record, and then select from different tables (or even different
datatypes!) to it in plpgsql: it accommodates these different things. 
The trade-off is that comparing a record to another record won't
always work: because what a record is is not pre-determined, you
can't have determinate rules for comparing one record to another. 
And without determinate rules, you can't have an equality operator.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
This work was visionary and imaginative, and goes to show that visionary
and imaginative work need not end up well.     --Dennis Ritchie


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

Предыдущее
От: "Ezequias Rodrigues da Rocha"
Дата:
Сообщение: Re: Round Numeric Type
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: record datatype comparisons