diff --git a/CHANGELOG b/CHANGELOG
index 0929e08..b5b78f9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -44,6 +44,7 @@ Fixes:
 * csvgrep can match multiline values.
 * csvgrep correctly operates on ragged rows.
 * csvsql correctly escapes `%` characters in SQL queries.
+* csvsql adds standard input only if explicitly requested.
 * csvstack supports stacking a single file.
 * csvstat always reports frequencies.
 * FilteringCSVReader's any_match argument works correctly.
diff --git a/csvkit/utilities/csvsql.py b/csvkit/utilities/csvsql.py
index 98c5e84..1da023e 100644
--- a/csvkit/utilities/csvsql.py
+++ b/csvkit/utilities/csvsql.py
@@ -11,7 +11,7 @@ from csvkit.cli import CSVKitUtility
 
 
 class CSVSQL(CSVKitUtility):
-    description = 'Generate SQL statements for one or more CSV files, create execute those statements directly on a database, and execute one or more SQL queries.'
+    description = 'Generate SQL statements for one or more CSV files, or execute those statements directly on a database, and execute one or more SQL queries.'
     override_flags = ['l', 'f']
 
     def add_arguments(self):
@@ -56,14 +56,6 @@ class CSVSQL(CSVKitUtility):
         else:
             table_names = []
 
-        # If one or more filenames are specified, we need to add stdin ourselves (if available)
-        if sys.stdin not in self.input_files:
-            try:
-                if not sys.stdin.isatty():
-                    self.input_files.insert(0, sys.stdin)
-            except:
-                pass
-
         # Create an SQLite database in memory if no connection string is specified
         if query and not connection_string:
             connection_string = "sqlite:///:memory:"
diff --git a/docs/scripts/csvsql.rst b/docs/scripts/csvsql.rst
index 3a9b4b0..f2dd003 100644
--- a/docs/scripts/csvsql.rst
+++ b/docs/scripts/csvsql.rst
@@ -16,7 +16,7 @@ Generate SQL statements for a CSV file or execute those statements directly on a
                   [--blanks] [--no-inference] [--db-schema DB_SCHEMA]
                   [FILE [FILE ...]]
 
-    Generate SQL statements for one or more CSV files, create execute those
+    Generate SQL statements for one or more CSV files, or execute those
     statements directly on a database, and execute one or more SQL queries.
 
     positional arguments:

csvsql without tty always tries to read stdin  
The following snip works from a terminal but fails in a non-interactive session (we hit it in Jenkins, but I'd guess it also fails in cron)

```
csvsql --table foo --query "select * from foo" foo.csv
``` 

You get a `StopIteration` exception because csvsql is trying to read from stdin, which has nothing coming (this line: https://github.com/wireservice/csvkit/blob/205175fb70745b80db19acd4c314ad6c774b7fc0/csvkit/utilities/csvsql.py#L57). There's a previous discussion of the issue at https://github.com/wireservice/csvkit/issues/342 and https://github.com/wireservice/csvkit/issues/627, but the linked commit doesn't solve the issue. 

We're working around it by always sending something in to stdin when running from a job. 

I think csvsql should require naming stdin with a "-" when you want to read from both files named as arguments and stdin. This is how `cat` works:

```
echo "foo" | cat /tmp/file.csv  # just prints file.csv
echo "foo" | cat - /tmp/file.csv  # prints foo, then file.csv
echo "foo" | cat /tmp/file.csv -  # prints file.csv, then foo
```


diff --git a/tests/test_utilities/test_csvsql.py b/tests/test_utilities/test_csvsql.py
index be7d54f..2135fad 100644
--- a/tests/test_utilities/test_csvsql.py
+++ b/tests/test_utilities/test_csvsql.py
@@ -67,7 +67,7 @@ class TestCSVSQL(CSVKitTestCase, EmptyFileTests):
         input_file = six.StringIO("a,b,c\n1,2,3\n")
 
         with stdin_as_string(input_file):
-            sql = self.get_output(['examples/dummy.csv'])
+            sql = self.get_output(['-', 'examples/dummy.csv'])
 
             self.assertTrue('CREATE TABLE stdin' in sql)
             self.assertTrue('CREATE TABLE dummy' in sql)

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose pytest
apt-get update apt-get install -y gcc
3.5
requirements-py3.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
agate==1.13.0
agate-dbf==0.2.3
agate-excel==0.4.1
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
-e git+https://github.com/wireservice/csvkit.git@70d641c60202c8c8d596d1bf90fb03b10a1a4614#egg=csvkit
dbfread==2.0.7
distlib==0.3.9
docutils==0.18.1
et-xmlfile==1.1.0
filelock==3.4.1
greenlet==2.0.2
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
isodate==0.6.1
Jinja2==3.0.3
leather==0.4.0
MarkupSafe==2.0.1
nose==1.3.7
olefile==0.47
openpyxl==3.1.3
packaging==21.3
parsedatetime==2.6
platformdirs==2.4.0
pluggy==1.0.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.2
python-slugify==6.1.2
pytimeparse==1.1.8
pytz==2025.2
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
SQLAlchemy==1.4.54
text-unidecode==1.3
toml==0.10.2
tomli==1.2.3
tox==3.28.0
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.17.1
xlrd==2.0.1
zipp==3.6.0

name: csvkit
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - agate==1.13.0
      - agate-dbf==0.2.3
      - agate-excel==0.4.1
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - dbfread==2.0.7
      - distlib==0.3.9
      - docutils==0.18.1
      - et-xmlfile==1.1.0
      - filelock==3.4.1
      - greenlet==2.0.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - isodate==0.6.1
      - jinja2==3.0.3
      - leather==0.4.0
      - markupsafe==2.0.1
      - nose==1.3.7
      - olefile==0.47
      - openpyxl==3.1.3
      - packaging==21.3
      - parsedatetime==2.6
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.2
      - python-slugify==6.1.2
      - pytimeparse==1.1.8
      - pytz==2025.2
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - sqlalchemy==1.4.54
      - text-unidecode==1.3
      - toml==0.10.2
      - tomli==1.2.3
      - tox==3.28.0
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.17.1
      - xlrd==2.0.1
      - zipp==3.6.0
prefix: /opt/conda/envs/csvkit

tests/test_utilities/test_csvsql.py::TestCSVSQL::test_create_table tests/test_utilities/test_csvsql.py::TestCSVSQL::test_launch_new_instance tests/test_utilities/test_csvsql.py::TestCSVSQL::test_no_header_row tests/test_utilities/test_csvsql.py::TestCSVSQL::test_no_inference
tests/test_utilities/test_csvsql.py::TestCSVSQL::test_query
tests/test_utilities/test_csvsql.py::TestCSVSQL::test_empty tests/test_utilities/test_csvsql.py::TestCSVSQL::test_empty_with_query tests/test_utilities/test_csvsql.py::TestCSVSQL::test_stdin tests/test_utilities/test_csvsql.py::TestCSVSQL::test_stdin_and_filename
docs/scripts/csvsql.rst csvkit/utilities/csvsql.py CHANGELOG
docs/scripts/csvsql.rst csvkit/utilities/csvsql.py CHANGELOG