Alter strings that don't belong to the application - Mailing list pgsql-hackers

From Dennis Björklund
Subject Alter strings that don't belong to the application
Date
Msg-id Pine.LNX.4.44.0306120836150.13332-100000@zigo.dhs.org
Whole thread Raw
Responses Re: Alter strings that don't belong to the application
List 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



pgsql-hackers by date:

Previous
From: "P.M"
Date:
Subject: PostgreSQL and Windows
Next
From: Srikanth M
Date:
Subject: Printing groupClause List