Re: Can we modify 'text *' passed to a C function?

Поиск
Список
Период
Сортировка
От m w
Тема Re: Can we modify 'text *' passed to a C function?
Дата
Msg-id 20010206015421.43033.qmail@web12404.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Can we modify 'text *' passed to a C function?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
--- Tom Lane <tgl@sss.pgh.pa.us> wrote:
> m w <mttf2000@yahoo.com> writes:
> > If I write a function that does a 'tolower()' on
> each
> > character of a parameter passed into my function,
> do I
> > have to allocate a new text object and initialize
> it
> > and copy the data, or can I modify that object in
> > place and return it?
> 
> You must NEVER alter a pass-by-reference parameter,
> of text or
> any other data type.  If you do, you are probably
> altering data
> in a disk buffer, thus changing the content of a
> tuple.

Thanks, I was concerned that may be the case, but I
could never find a definitive answer on this.

__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump data integrity & java
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: RE: Re: PostgreSQL -> PHP problem