Re: Patch for DBD::Pg pg_relcheck problem

Поиск
Список
Период
Сортировка
От David Wheeler
Тема Re: Patch for DBD::Pg pg_relcheck problem
Дата
Msg-id ADD3699E-0FD0-11D7-8FFE-0003931A964A@wheeler.net
обсуждение исходный текст
Ответ на Re: Patch for DBD::Pg pg_relcheck problem  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Patch for DBD::Pg pg_relcheck problem  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-interfaces
On Saturday, December 14, 2002, at 05:46  PM, Bruce Momjian wrote:

> I thought you had that figured out, by flagging the param as bytea
> somehow?  Are you thinking of something automatic?

No. Baldur Kristinsson points out that some people may pass a string 
with NUL characters to DBD::Pg to be inserted into something other than 
a bytea column. We have to figure out what to do when they do that. 
Baldur Kristinsson thinks we should just quietly strip them out (and 
throw a warning). Others think that it should throw an exception and 
croak. Tim said:
  The driver should always try to be as transparent as possible.  The general principle is "don't mes with the users
dataunless  they've specifically asked you to (cf. ChopBlanks)".
 

Since, however, nulls aren't really allowed in any PostgreSQL data type 
(except bytea, and then only if specifically bound as such to a 
prepared statement), I'm not sure what to do about this. We can't leave 
the data alone unless we just want PostgreSQL to throw an error (likely 
to be a mysterious error, as the user won't know why her data is 
getting truncated).

I think...throw an exception, since PostgreSQL can't handle the null 
byte. Then it will be up to the user to clean up her data, and we won't 
have to touch it.

Thoughts?

David

-- 
David Wheeler                                     AIM: dwTheory
david@wheeler.net                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e                                               Jabber:
Theory@jabber.org



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: python bug
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Patch for DBD::Pg pg_relcheck problem