<div dir="ltr">I'm getting this <br>Warning 1: layer names ignored in combination with -sql.<br><br>However, I need to use the -sql query as I'm adding fields and populating them as I go.<br><br>The source dataset cannot be edited. <br><br>I'm trying to combine several datasets into various tables in PostGIS, where there's a name difference between the source layer and the PostGIS table name.<br><br>my command is in this format.<br>ogr2ogr -f PostgreSQL -a_srs "EPSG:4326"  PG:dbname=SomeDB <insert some options> Sourcedata -nlt POLYGON -skipfailures -explodecollections -sql "SELECT *,'VALUE1' AS valuefield, 1 as anotherfield FROM <layer> WHERE OGR_GEOMETRY='POLYGON' OR OGR_GEOMETRY='MULTIPOLYGON'" <layer><br><br>I wish to not put it in a table named <layer> in my PostGIS/SomeDB, but rather <layer>+somesuffix<div><br></div><div>This is easy with -nln, but when I added the -sql, I get the warning above, and it seems to drop it in just <layer> and not <layer>+somesuffix.</div><div><br></div><div>How can I accomplish what I want? </div><div>This is ultimately run on many datasets, so it will be appending to existing tables (or create them if they didnt exist yet). </div><div><br></div><div>-Mike</div></div>