Alter strings that don't belong to the application

From: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Alter strings that don't belong to the application
Date: 2003-06-12 06:53:41
Message-ID: Pine.LNX.4.44.0306120836150.13332-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 can't find in the docs anything that says that it is okay to alter the
returned string. It works since it's allocated and stored in the PGresult
(I assume), so it's local to one result. But it's not obvious to me just
looking at the API that it's allowed.

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

--
/Dennis

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-06-12 09:35:17 Re: Pre-allocation of shared memory ...
Previous Message P.M 2003-06-12 06:10:06 PostgreSQL and Windows