Skip to content

Commit

Permalink
PostgreSQL: do not attempt to create VARCHAR(n) columns with n >= 104…
Browse files Browse the repository at this point in the history
…85760 (fixes #1508)
  • Loading branch information
rouault committed May 6, 2019
1 parent 25c839a commit d30dd0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdal/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ CPLString OGRPGCommonLayerGetType( OGRFieldDefn& oField,
{
if (oField.GetSubType() == OFSTJSON )
pszFieldType = CPLGetConfigOption("OGR_PG_JSON_TYPE", "JSON");
else if (oField.GetWidth() > 0 && bPreservePrecision )
else if (oField.GetWidth() > 0 && oField.GetWidth() < 10485760 && bPreservePrecision )
pszFieldType = CPLSPrintf( "VARCHAR(%d)", oField.GetWidth() );
else
pszFieldType = CPLGetConfigOption("OGR_PG_STRING_TYPE", "VARCHAR");
Expand Down

0 comments on commit d30dd0c

Please sign in to comment.