View Ticket
Not logged in
Ticket Hash: d86ac2c812abe957e29504f5ba2b64c92f896834
Title: Meta command .schema gives error "Error: no such column: rowid"
Status: Closed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Resolution: Works_As_Designed
Last Modified: 2023-07-23 13:07:48
Version Found In:
User Comments:
anonymous added on 2023-02-24 06:15:59:

Running ".schema" in spatialite CLI always results in this error.

spatialite> .schema B
Error: no such column: rowid

For the same database and same table it works well if using regular sqlite CLI.

sqlite> .schema A
CREATE TABLE A ( name TEXT );

The result is the same for all tables, whether created in spatialite or sqlite, and whether it contains geometry or not.

Sincerely, Thomas

Installation details:

SpatiaLite version ..: 5.0.1	Supported Extensions:
	- 'VirtualShape'	[direct Shapefile access]
	- 'VirtualDbf'		[direct DBF access]
	- 'VirtualText'		[direct CSV/TXT access]
	- 'VirtualGeoJSON'		[direct GeoJSON access]
	- 'VirtualXL'		[direct XLS access]
	- 'VirtualNetwork'	[Dijkstra shortest path - obsolete]
	- 'RTree'		[Spatial Index - R*Tree]
	- 'MbrCache'		[Spatial Index - MBR cache]
	- 'VirtualFDO'		[FDO-OGR interoperability]
	- 'VirtualBBox'		[BoundingBox tables]
	- 'VirtualSpatialIndex'	[R*Tree metahandler]
	- 'VirtualElementary'	[ElemGeoms metahandler]
	- 'VirtualRouting'	[Dijkstra shortest path - advanced]
	- 'VirtualKNN'	[K-Nearest Neighbors metahandler]
	- 'VirtualGPKG'	[OGC GeoPackage interoperability]
	- 'VirtualXPath'	[XML Path Language - XPath]
	- 'SpatiaLite'		[Spatial SQL - OGC]
PROJ version ........: Rel. 8.2.1, January 1st, 2022
GEOS version ........: 3.10.2-CAPI-1.16.0
RTTOPO version ......: 1.1.0
TARGET CPU ..........: x86_64-linux-gnu
SQLite version ......: 3.37.2

sandro added on 2023-07-23 13:07:48:

note: the spatialite CLI tool by many years is in a "frozen" state, as announced on the projects's mailing list:

https://groups.google.com/g/spatialite-users/c/XBKhuANP6u8/m/3n7-EdVb_EIJ

in other words: it's an old tool out of maintainance that still continues to be distributed simply because many users were quite happy with it as it was.

the suggested full replacement is to always use sqlite3 (the "official" CLI front end of SLite) then loading 'mod_spatialite' as a dynamic extension.