Re: Add error-checking to timestamp_recv

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Add error-checking to timestamp_recv
Дата
Msg-id 20040520170155.GY11196@ns.snowman.net
обсуждение исходный текст
Ответ на Re: Add error-checking to timestamp_recv  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Add error-checking to timestamp_recv  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
* Bruce Momjian (pgman@candle.pha.pa.us) wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > I wasn't aware you could throw binary values into the timestamp fields
> > > like that.  I thought you needed to use a C string for the value.
> >
> > This facility was added in 7.4 as part of the wire-protocol overhaul.
> > It's nothing directly to do with PREPARE; you could get the same result
> > with no prepared statement using PQexecParams.
>
> Ah, no wonder I had not seen that before.  So, I guess the issue is how
> much error checking do we want to have for these binary values.  I was a
> little disturbed to hear he could insert data he couldn't later view.
> How many datatype have this issue?

I don't think that many do..  A number of them already check incoming
values where it's possible for them to not be valid.  For example,
'macaddr' accepts all possible binary values, 'inet' does error checking
on input.  Binary timestamps were the only place I found in the work I
was doing where this could happen and I managed to mess up most of the
fields in one way or another before I figured it all out. :)

    Stephen

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Add error-checking to timestamp_recv
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Add error-checking to timestamp_recv