U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » Postgres library improvements
Re: Postgres library improvements [message #23024 is a reply to message #22981] Tue, 08 September 2009 16:02 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 332
Registered: July 2009
Senior Member
luzr wrote on Fri, 04 September 2009 14:24

So it happened, we achieved to broke important existing application...


Sorry to hear that.
But your solution does the conversion twice (first one on database server side, and the second one in the application). To be honest, I don't see much sense in this solution. It would be much easier to give user a choice by adding new parameter to PostgreSQLSession::Open(const char *connect, bool autoconvert = false);
By default conversion can be turned off (for compatibility with older applications).

Another problem is in ErrorMessage function:
Now:
{
	if(PQclientEncoding(conn) >= 0)
		/* Client is connected, you should use FromCharset here */
		return PQerrorMessage(conn);
	/* Client is disconnected, use system code page */
	return FromCharset(PQerrorMessage(conn));
}

Proposition:
{
	if(PQclientEncoding(conn) >= 0)
		return FromCharset(PQerrorMessage(conn))
	return FromSystemCharset(PQerrorMessage(conn));
}


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postgresql and bool
Next Topic: Acquiring large record
Goto Forum:
  


Current Time: Sun Sep 13 21:59:14 GMT+2 2026

Total time taken to generate the page: 0.00772 seconds