GDAL-VECTOR-SQL(1) GDAL GDAL-VECTOR-SQL(1) >>> (NAME) gdal-vector-sql - >>>>> >>>>>(>>) SQL >> >>> >> >>>>>> >>>> >>>>>> >>> >> >>>> 3.11. >>>>> >>>>> (SYNOPSIS) Usage: gdal vector sql [OPTIONS] [] Apply SQL statement(s) to a dataset. Positional arguments: -i, --dataset, --input Input vector datasets [required] [not available in pipelines] -o, --output Output vector dataset [not available in pipelines] Common Options: -h, --help Display help message and exit --json-usage Display usage as JSON document and exit --config = Configuration option [may be repeated] -q, --quiet Quiet mode (no progress bar or warning message) [not available in pipelines] Options: -f, --of, --format, --output-format Output format ("GDALG" allowed) [not available in pipelines] --co, --creation-option = Creation option [may be repeated] [not available in pipelines] --lco, --layer-creation-option = Layer creation option [may be repeated] [not available in pipelines] --overwrite Whether overwriting existing output dataset is allowed [not available in pipelines] --update Whether to open existing dataset in update mode [not available in pipelines] --overwrite-layer Whether overwriting existing output layer is allowed [not available in pipelines] --append Whether appending to existing layer is allowed [not available in pipelines] Mutually exclusive with --upsert --skip-errors Skip errors when writing features [not available in pipelines] --sql |@ SQL statement(s) [may be repeated] [required] --output-layer Output layer name(s) [may be repeated] --dialect SQL dialect (e.g. OGRSQL, SQLITE) Advanced Options: --if, --input-format Input formats [may be repeated] [not available in pipelines] --oo, --open-option = Open options [may be repeated] [not available in pipelines] --output-oo, --output-open-option = Output open options [may be repeated] [not available in pipelines] --upsert Upsert features (implies 'append') [not available in pipelines] Mutually exclusive with --append >>>>>>> (DESCRIPTION) >>>>> gdal vector sql >> >> >>> >>>> >>>>>>>>>>> >> >>>>>>> SQL >> >>>>>>>>>>>>. >> >>>> GDAL 3.12 >> >>>> >>>>> >>>>>>> >> --update> > >>>> >>>> >>>> >> >>>>>> >>>> >>>>>> >>> >>>>> >>>>>>>> >>>> >>>>> >>>>>>>> >> >>>>>> >>>> >>>>> >> >>>>> >>>>>>>> >>>>> UPDATE> DELETE > >>>> >> >>> >>>. >>>>> GDALG (>>>>>> >>>> >>>> / >>>>>>) (GDALG OUTPUT (ON-THE-FLY / STREAMED DATASET)) >>> >>>>>> >> >>>>>>>>>> >> >>>>> >> >>>>> >> >>>> JSON >> >>>>>>> >> >>>> >>>>> GDALG >>>>>>>> >>>>>>. >>>> >>>> >> >>>>>>> >>> >> >>>>> >> >>>>>> >>>> >>>>>> >> >>>>>>> >> >>>>>> GDALG: GDAL Streamed Algorithm >>> >>>> > >> >>>> >>>>>>>> >> >> >>>> >>>> / >>>>>> (on-the-fly / streamed) >>>>> >>>>. >>>>>>>>> >>>>>>> >>>>>> (PROGRAM-SPECIFIC OPTIONS) --output-layer >>>(>>>) >>>> SQL >>>>>. >> >>>> >>>> >>>>> >> >>> >>>> >>>>> >>>>> "SELECT" >>>> >>> >>>>> >>>. >>>> >> >>>>> >>>>>>> SQL >>>> >>>> >> >> >>>> >>>>> >>>>>>> --output-layer> > >> >> >>>> >> >>>>>>> >>>> >> >> >> >>> >>>>>>> >> >>>> >> >>>>>> >>> >>>>>>>. --quiet >>>>>> >>> >> >>>> 3.12. >>>>>> >>>> >>>>>>>> >>>>>>>> >>>>>>>. --sql |@ >>>>> SQL >>>> >>>> >> >> >>>>/>>>> >> >>>>>>>>>>>> (>>>>>>> >> >>>>> SELECT). >>>>>>>> >>>> >>>>> >>>>> >>>> >>>>> >>>>> >>> (>>>>> --sql >> >>>> >> >>>> >>>>>). --dialect >>>> SQL. >> >>> >>>>>>> >>>>> >>>>>>> >> gdal vector sql> >>>> >>>> SQL >> RDBMS >>>>>>> >>>>>>. >> >>>> >>>>>>> >> sql >> >>>>> >>>>>>>> >> gdal vector pipeline> >>> >>>>> >>>> >>>>> >>>>>> >>> >> >>>>> >>> >> sql >>>>> read >>>>> >> >>> >>> >>>> >> >>>> OGRSQL >>>>>>> >>>>>>. >>> >> >>>> >>>> >> >>>> >>>> >> SQL >>>>>>>> >>>>> >>>> >>>>>>> >>>>>>> >> >>>> OGRSQL >>>> >> >>>>>>>> >> >> >>>> >>>>>>> >>> >>>> >>>. >>>> SQL SQLite dialect >> >>>>>>> >> >>>>>> >>>> SQLITE > INDIRECT_SQLITE >>>>>> >>>> > >>>>>>> >> >> >> >> >>>> >>>>>>> >>>>>>> >>>>. >>>>>>> >>>> >>>> >>>>>>> >>>> >>> >>>>>> >>>> >>>> >>>>>>>>>> >>>>>>>> >>>>> SQL >> >>>>>> >>>>> >>>>>. >>>>>>>> >>>>>>>>>>>> >> >>>>>>> >> gdal --format >>>>> >>>. >>>> >>>>: $ gdal --format "PostgreSQL" [...] Supported SQL dialects: NATIVE OGRSQL SQLITE [...] $ gdal --format "ESRI Shapefile" [...] Supported SQL dialects: OGRSQL SQLITE [...] --append >>> >>>>> >>>>> >> >>>>(>>>) >>>>> >>>> >>> >> >>>. >>> >>>>> >> >>>> >>> >>>> >>>>>> >>>> >>>>>> >> >> >>> >>>>> >>>>>>. --co, --creation-option = >>>>>> >> >>>>>>> >> >> >>> >>>>> >>>>>>> >>>> >>>>>> >>>> >>>>> >> >>>>>>> >> >>>>> >>>> >>>>> >>>>>> >>>> >>>>>>>> >>>>>>> >>>. >>>> >>>>>> >>>>>> GeoPackage >> >>>>>>>>> >>>>> >>>> >>>>> >>>> >>>>>>>> >>>>>>. >>>>>>>> >>>>> >>>. >>>>>>>>> >>>> >>>>>> >>>> >> >>>>>> >>>> >> >>>>>> >>>> >>>>>> >>>>> > >>>> >>>>>>>> >>>> >>>>> >>> >>>>> >>>>> >>>>>>. >>>>>> >> >>>>>>>>> >>>>>>>>>>>> >>>> >> >>>> >> >>>>>>> >> >>>>> >> >>>>> --formats >>>>>> >>>> >>> >>>>>>> >>>>> >> >>>> >>>> >>>> >>>> >>>>>>> >>>>>> >>>>>>>>> >>>> >>>>>> >>>. >>>> >>>>>> >>>>>>>>> >>>> >>>> >>>> >> >>>>> >> >>>>>>> >>>>>>> >>>> >> Vector drivers >>>>>> >>>>. >>>> >>>>> >>>>> >> >>>>>>>>> >>>> >>>>>> >>>> >> >>>>>>>>> >>>> >>>> >>>>>> >>>>>. --if, --input-format >>> >>>>/>>>>>>> >> >>>> >>>> >>> >>>> >>>>(>>>) >>>>> >>>>>> >>>. >>>>>> >>>>> >> >>>> >>>> >> >>>>> >>> >> >>>>>> >> >>>>> >>>>>> >>>>>> >> >>>>>> >>>>>> >>>>> >>>>>> >>>> >>>>>>> >> >> >>>> >>>>>> >>>>> >>>>> >>>>>> >>>>>>> >>>. >>> >>>>> >>>>>>>> >>>>> >>> >>>> >>>> >>>> >>> >>>>>> >>>>>> >>>>> >>>. >>>> >>>>> >>>>> >> >>> >>>>> >>>>>>>>> >>>>> >> >>>>> >> >>> >>>> >>>>>> >>>> >>>>>>>. >>>>>>>> >>>> >>>>>>>> >>>>>>>>>>>>> >>>> >>>>> >>>> >>>>>. >>>>>>>> >>>>> >>>. --lco, --layer-creation-option = >>>>>> >> >>>>>>> >> >> >>> >>>>> >>>>>>> >>>> >>>> >>>>> >> >>>>>>> >> >>>>> >>>> >>>>> >>>>>> >>>> >>>>>>>> >>>>>>> >>>. >>>> >>>>>> >>>>>> GeoPackage >> >>>>>>>>> >>>> >>>> >>>> >>>>> >>>>> >>>>> >> >>> >>>> >>>>>> >>>>> >>>>> >> >>>>>>> > >>>> >>>>>>>> >>>>>>. >>>>>>>> >>>>> >>>. >>>>>>>>> >>>> >>>> >> >>>>>> >>>> >> >>>>>> >>>> >>>>>> >>>>> > >>>> >>>>>>>> >>>> >>>>> >>> >>>>> >>>> >>>>>>> >>>>>>. >>>>>> >> >>>>>>>>> >>>>>>>>>>>> >>>> >> >>>> >> >>>>>>> >> >>>>> >> >>>>> --formats >>>>>> >>>> >>> >>>>>>> >>>>> >> >>>> >>>> >>>> >>>> >>>>>>> >>>>>> >>>>>>>>> >>>> >>>>>> >>>. >>>> >>>>>> >>>>>>>>> >>>> >>>> >>>> >> >>>>> >> >>>>>>> >>>>>>> >>>> >> Vector drivers >>>>>> >>>>. >>>> >>>>> >>>>> >> >>>>>>>>> >>>> >>>> >> >>>>>>>>> >>>> >>>>>> >>>> >>>>>> >>>>>. --oo, --open-option = >>>>> >>> >>>> >>>>>> >>>> (>>>> >> >>>>). >>>>>>>> >>>>> >>>. -f, --of, --format, --output-format >>>> >>>>>> >>>>> >>>> >>>>>>>. >>>>>> >>>> >> >>>>>>> >> >>>>> >>> >> >>> >>>>: gdal --formats | grep vector | grep rw | sort --output-open-option, --output-oo = >> >>>> 3.12 >>>>> >>. >>>>> >>> >>>> >>>>>> >>>> >>>> >>>>>> >>>> >>>>> (>>>> >> >>>>). >>>>>>>> >>>>> >>>. --overwrite >> >>>>>> >>>>> >>>>>> >>>> >> >>>>>> >>>> >>>> >>>>> >> >>>>>>>> >>>. >> >>> >>> >>>>> >>>>>> >>>>>>>> >>> >>>> >> >>>>>> >>>> >>>> >> >>> >>>> >>>>> >>>>> gdal >> >>> >>>>> >>>>>>. --overwrite-layer >>> >>>>>>>> >>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >>>. --skip-errors >> >>>> 3.12 >>>>> >>. >>> >>>>>> >>>>> >> >>>>> >>>>>(>>) >>>> >>>>>> >>>>> >>>> >> >>>. >>>> >>>>> >>>>> >> >>> >>>>> >>>>>> >>>> >>>>>> >> >> >>> >> >>>>> >> >> >>>> >>>>> >>>>>> >> >>>> >>> >>>>> >>> >> >>>>>>>>>> >>>> >>>> >>> >>>> >>>> >>>. --update >>> >>>>>> >>>> >>>>> >>>>> >> >>>> >>>>>>>>>>> >>> >>> >> >>>. --upsert >> >>>> 3.12 >>>>> >>. >>>>>>> >> --append >> >> >> >> >>> >>>>> >> OGRLayer::CreateFeature()> >> >>>>>> OGRLayer::UpsertFeature() >>>> >>> >> >>>>>>>>>>> >>>>> >>>>>>> >>>>>>. >>> >>>>>> >> >>> >>>> >>>> >> >>> >>>>>> >>>>>>>>>> >>> >>>: GPKG -- GeoPackage vector> Elasticsearch: Geographically Encoded Objects for Elasticsearch > MongoDBv3 (>>>>>>>>>> >> upsert >> >>>>>>>>>> >>>>>>>>> >>>>>> GDAL_DCAP_UPSERT >> >>>>> >>>>>>>). >>>>>> upsert >> >>>> >>>>>>>> >>> FID >>>>> >>>>> (> >>>> >>>>> >>> >>>> FID)> >> >> >> >>>>> >>>> >>>> >>>>>>>>>>> >>>>> >>>>> >>>>>>> >>>>>>. >>>>> >>>>> >>> >> >>>>>>> >>>> >>> FID >> >>>>>>>> >>>> > >>>> >> >>>>>> >>>>>> >>>>>. >>>> >>>>>> GPKG> >> >>>>> >> >> >>>> UNIQUE >>>> >>>>> >>>> >> >>>> >>>> >>> >>>> (integer primary key) >>>>>> >>>>> upsert >>>> >>>>>> >> FID >>>>> >>>>> >>>> >> >>>>>>>> (non-significant) >>> >>> >>>>>>>>>> >>> (>> >>>>> --unset-fid >> >>>>> gdal vector edit >>>>>>> >>>> >>>>>> >>>>> FID >>>>> >>>> >>>>>>> >>>). -q, --quiet >>>>>>> >>>> >>>> >>>>>> > >>>> >>>>>>>> >>>>>. >>>>>> >> >>>> >>>>>> >> >>>>> > > >> >>>> >>>> >>> >>>>>> >>> >>> >>>>>>>>>>>> (>>>>>> >>>>>>>>>>>>> >> >> >>>> >>>>> >>>> >>>>>>>> >>>>> >>>>>>>>>>> >> >>> >>>>> >>>>>>>). >>>>>>> (EXAMPLES) >>>> >: >>>>> >> >>>> GeoPackage >> >>>>>>> >>>>>>>> >> >>>> >>>>> >>>>> $ gdal vector sql in.gpkg out.gpkg --output-layer country_sorted_by_pop --sql="SELECT * FROM country ORDER BY pop DESC" >>>> >: >>>>> >> >>>> GeoPackage >> > >>>> >>>>>>> SQL $ gdal vector sql in.gpkg out.gpkg --output-layer=beginning,end --sql="SELECT * FROM my_layer LIMIT 100" --sql="SELECT * FROM my_layer OFFSET 100000 LIMIT 100" >>>> >: >>>>> >>>>>> (in-place) >> >>>>>>>>>>> GeoPackage $ gdal vector sql --update my.gpkg --sql "DELETE FROM countries WHERE pop > 1e6" >>>> >: >>>>>> >> >>>> >>>> >> >>>> >>>>> >> GeoPackage $ gdal vector sql --update my.gpkg --sql "ALTER TABLE countries ADD COLUMN abbrev STRING(10)" >>>> >: >>>>> >> >> >>>> >>>>> >> >> >>>> GeoPackage $ gdal vector pipeline read europe.gpkg ! \ sql --sql "SELECT * FROM country WHERE pop > 1e6" ! \ write --append --output-layer-name=world world.gpkg >>>>>>>>> (AUTHORS) Even Rouault >>>>>>>> > >>>>> (COPYRIGHT) 1998-2026 August 18, 2026 GDAL-VECTOR-SQL(1)