turbot / steampipe-plugin-csv

Use SQL to instantly query data from CSV files. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/csv
Apache License 2.0
19 stars 4 forks source link

error if csv filename begins with a number #18

Closed judell closed 2 years ago

judell commented 2 years ago

To reproduce, convert a file that works properly, with a name like foo.csv, to instead be 1foo.csv.

Error: syntax error at or near "1" (SQLSTATE 42601)

judell commented 2 years ago

You can do this:

select * from csv.foo

But not:

select * from csv.1foo

It has to be:

select * from csv."1foo"

cbruno10 commented 2 years ago

@judell I believe that's normal Postgres behaviour, as it expects table names to start with a lowercase letter or an underscore (there may be other symbols they accept). If the table name does not start with one these characters, you need to wrap it in double quotes.

I'm closing this issue as I don't believe it's a bug in the CSV plugin, but instead expected behaviour from Postgres.

judell commented 2 years ago

Yeah I did not mean to reopen, sorry.