Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 327
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 Aug 24 22:23:44 CEST 2025

Total time taken to generate the page: 0.05411 seconds