Re: Alter strings that don't belong to the application

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Alter strings that don't belong to the application
Дата
Msg-id 29261.1055424573@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Alter strings that don't belong to the application  (Dennis Björklund <db@zigo.dhs.org>)
Ответы Re: Alter strings that don't belong to the application  (Dennis Björklund <db@zigo.dhs.org>)
Список pgsql-hackers
Dennis Björklund <db@zigo.dhs.org> writes:
> I've been looking into the code of psql to fix a problem with charsets and
> noticed that psql changes the strings it gets back from functions like
> PQfname() and PQgetvalue().

I'd call that a bug in psql.  Where do you see it happening exactly?

> Or should I read that the return value is "char *" and not "const char *" 
> as it's okay to alter it?

No, I think the return value ought to be treated as const char *.
We're hesitant to actually declare it that way because we'd cause compile
errors in many client applications that aren't being const-paranoid.
But the app has no business modifying those values.
        regards, tom lane


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

Предыдущее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: Pre-allocation of shared memory ...
Следующее
От: Rod Taylor
Дата:
Сообщение: CVS -Tip compile issue -- FreeBSD 4.8