Hi all
I use the Postgis quite a lot for a couple of projects.
In the backend/psotgresql/statement.cpp describe_column function the
typeoid is used for determining actual soci type. This works fine for
the built-in PostgreSQL types since the OID's are hard coded.
However
for user defined types this will not work. As far as I understand we are
not guaranteed that they will remain static. Again as far as I
understand these user defined types are usually handled as strings.
A
proposal could be something like the following where we check for a
string representation with an undefined size and take a "guess" that
this will be a dt_string type.
Does anybody know if this is a valid
assumption ?
default:
{
int form = PQfformat(result_, pos);
int
size = PQfsize(result_, pos);
if (form == 0 && size == -1)
{
type =
dt_string;
}
else
{
std::stringstream message;
message << "unknown
data type with typelem: " << typeOid << " for colNum: " << colNum << "
with name: " << PQfname(result_, pos);
throw
soci_error(message.str());
}
}
I didn't want to make a pull request
(yet) since I am not sure if this valid.
Poul
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
soci-devel mailing list
soci-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/soci-devel