Column name length limitation removed. Patch submitted by Bernhard

Reiter <bernhard@intevation.de>


git-svn-id: http://svn.osgeo.org/postgis/trunk@139 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Paul Ramsey 2002-04-26 16:13:33 +00:00
parent c0659de4ea
commit e65163c6fc

View file

@ -256,12 +256,17 @@ printf(conn_string);
}
if(size==-1 && type != OID){ //-1 represents variable size in postgres, this should not occur, but use 32 bytes in case it does
query1 = (char *)malloc(60); //hardcoded size for the following query
strcpy(query1,"select max(octet_length(");
//( this is ugly: don't forget counting the length
// when changing the fixed query strings )
query1 = (char *)malloc(
24+strlen(PQfname(res, i))+8+strlen(table)+1 );
strncpy(query1,"select max(octet_length(",24+1);
strcat(query1,PQfname(res, i));
strcat(query1,")) from ");
strncat(query1,")) from ",8);
strcat(query1,table);
res2 = PQexec(conn, query1);
free(query1);
if(PQntuples(res2) > 0 ){
char *temp_int = (char *)PQgetvalue(res2, 0, 0);