Re: funny (cache (?)) bug in postgres (7.x tested)

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: funny (cache (?)) bug in postgres (7.x tested)
Дата
Msg-id 200107032103.f63L3v424094@jupiter.us.greatbridge.com
обсуждение исходный текст
Ответ на funny (cache (?)) bug in postgres (7.x tested)  (RISKO Gergely <risko@atom.hu>)
Список pgsql-hackers
RISKO Gergely wrote:
[Charset iso-8859-1,iso- unsupported, skipping...]

> Hello!
>
> I found a funny bug in postgres with c functions. (or feature??)
> Let's say we have got an function like this:
> CREATE FUNCTION hupper(text)
> RETURNS text
> AS '/fun.so'
> LANGUAGE 'c';
   This  is  actually  neither a feature, nor a bug in Postgres.   Your function is violating some coding rules.
   The text argument handed into is actually residing inside the   shared buffer cache. So you're not supposed to
changeit!
 
   Your function isn't safe for compressed or toasted values. If   you accidentially have big data  in  that  column,
it might   crash the backend completely.
 
   A  function  returning  text has to allocate the return value   with palloc().
   Look into utils/adt/*.c for examples how  to  deal  correctly   with text attributes.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



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

Предыдущее
От: "Rod Taylor"
Дата:
Сообщение: Re: Re: Backup and Recovery
Следующее
От: "Rod Taylor"
Дата:
Сообщение: Re: New SQL Datatype RECURRINGCHAR