libpq error message deallocation

From: icholy <ilia(dot)choly(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq error message deallocation
Date: 2012-12-04 18:38:04
Message-ID: 1354646284445-5735032.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PQerrorMessage function return char const*
char const* msg = PQerrorMessage(conn);
Now since it's const, I don't think I should be deallocating it and I've
never seen that done in any examples. But then, when and how does it get
freed?
At first I thought it gets deallocated once another error message is
requested but that's not the case.
// cause some error char const* msg1 = PQerrorMessage(pgconn); //
cause another error char const* msg2 = PQerrorMessage(pgconn); //
still works std::cout << msg1 << msg2 << std::endl;
Can someone shed some light on this for me?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/libpq-error-message-deallocation-tp5735032.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dmitriy Igrishin 2012-12-04 19:14:19 Re: libpq error message deallocation
Previous Message Edson Richter 2012-12-04 17:06:05 Re: Which is faster: char(14) or varchar(14)