BUG: Dataframe's to_sql
method fails while trying to persist Dataframe to Postgtres in Version 2.2.0
#57196
Open
3 tasks done
Labels
Bug
IO SQL
to_sql, read_sql, read_sql_query
Needs Triage
Issue that has not been reviewed by a pandas team member
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Exporting a pandas dataframe to Postgres doesn't work anymore in version 2.2.0. The code above works well with version 2.1.2, but in version 2.2.0 it fails with the following error:
I noticed that a new driver was added in Version 2.2.0, which might be related to my issue.
Expected Behavior
The code above should execute the same way it used to do with the previous version, and export the dataframe to a table in my Postgres Database.
Installed Versions
INSTALLED VERSIONS
commit : c3014ab
python : 3.9.13.final.0
python-bits : 64
OS : Darwin
OS-release : 23.1.0
Version : Darwin Kernel Version 23.1.0: Mon Oct 9 21:32:52 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T8122
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_GB.UTF-8
pandas : 3.0.0.dev0+210.gc3014abb3b
numpy : 1.26.3
pytz : 2023.4
dateutil : 2.8.2
setuptools : 68.2.2
pip : 23.3.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.1.0
html5lib : None
pymysql : None
psycopg2 : 2.9.9
jinja2 : 3.1.3
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: