PostgreSQL 驱动程序崩溃在 SQLColAttribute 崩溃

标签 postgresql postgresql-9.1 unixodbc

描述: 我使用 postgresql 数据库作为后端,使用 unixodbc 驱动程序管理器和 libodbc++ 库以及 psqlodbc 驱动程序连接到 postgresql。当我尝试运行我的应用程序来查询一些数据时,它崩溃了。它正在崩溃 随机函数。

我无法准确追踪它崩溃的是哪个函数。

它在三个函数处崩溃,比如

<强>1。 SQLColAttribute 2.SQLGetInfo

您正在运行的 PostgreSQL 版本号:

你是如何安装PostgreSQL的:PostgreSQL 9.1 linux ubuntu

对 postgresql.conf 文件中的设置所做的更改:否

操作系统及版本:linux ubuntu 12.04(64位)

您使用什么程序连接到 PostgreSQL:libodbc++-0.2.3 (libodbc++) 库

PostgreSQL odbc 驱动程序:psqlodbc 版本(3.03)

ODBC 使用:unixODBC-2.3.2

对于任何类型的错误的问题:

描述:我正在尝试将我的应用程序连接到 PostgreSQL。当我尝试运行选择查询时,它在某些功能上崩溃了。

我正在使用带有 unixODBC (2.3.2)、PostgreSQL 数据库 (9.1)、psqlodbc 驱动程序 (3.03)、libodbc++-0.2.3 的 linux ubuntu (12.04)

感谢和问候 巴拉克里希纳

这是生成的 BackTrack 报告。

#5  0x0000000002114936 in SQLGetInfo (connection_handle=0x7fff7003f190, info_type=151, info_value=0x7fffdfff93f4, buffer_length=4, string_length=0x7fffdfff93fa)
    at SQLGetInfo.c:560
        connection = 0x7fff7003f190
        ret = 0
        s1 = "\033\000\000\000\000\000\000\000\033\000\000\000\000\000\000\000@\226\377\337\377\177\000\000\001\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\225\fd\366\377\177\000\000-\023\005p\377\177\000\000\002\000\000\000\000\000\000\000\033", '\000' <repeats 15 times>, "@\226\377\337\377\177\000\000\355M\364\366\377\177\000\000-\023\005p\377\177\000\000\002\000\000\000\000\000\000\000\200\223\377\337\377\177\000\000\211\332\362\366\377\177\000\000\000\000\000\000\000\000\000\000R\221\350\001\000\000\000\000\220\361\003p\377\177\000\000\257\223\377\337\377\177\000\000-\023\005p\377\177\000\000+\023\005p\377\177\000\000(\023\005p\377\177\000\000\002\000\000\000\000\000\000\000\000\037\005p\377\177\000\000\000\000\000\000\070\000\000\000\005\000\000\000\000\000\000\000\377\377\377\377\377\377\377\377\220 \005p"
#6  0x00000000020dd764 in odbc::DatabaseMetaData::_getNumeric32 (this=0x7fff70051a20, what=<optimized out>) at databasemetadata.cpp:150
        res = <optimized out>
        t = 4
        r = <optimized out>
#7  0x0000000002100085 in odbc::DriverInfo::DriverInfo (this=0x7fff70052090, con=0x7fff7003eec0) at driverinfo.cpp:59
        md = 0x7fff70051a20
        r = <optimized out>
#8  0x00000000020dbeef in odbc::Connection::_connect (this=0x7fff7003eec0, dsn=..., user=..., password=...) at connection.cpp:213
        r = <optimized out>
#9  0x00000000020d9e4f in odbc::DriverManager::getConnection (dsn=..., user=..., password=...) at drivermanager.cpp:260
        con = 0x7fff7003eec0
#10 0x000000000133f105 in ODBCDatabase::Connect (this=0x7fff70053f40, properties=...) at StoreGrid/source/Database/ODBC/ODBCDatabase.cpp:134
        retryCount = 5
        triedCount = 1
        postgresConnectionString = {static npos = <optimized out>,
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x2e09678 ""}}
        sgConfig = 0x4f5c7e

最佳答案

我解决了这个问题。崩溃的问题是由于 UnixODBC 库。它已在 UnixODBC 2.3 版本中修复。

关于PostgreSQL 驱动程序崩溃在 SQLColAttribute 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26386731/

相关文章:

postgresql - 如何识别禁用真空的表

postgresql - 如何在客户端代码中获取\计时结果?

sql - 检查表字段postgres的唯一性

django - 如何加速使用 .distinct() 的查询集?

sql-server - 在 Linux/Ubuntu 上使用 Nodejs + MSSQL

unix - iODBC 和 unixODBC 之间的功能差异是什么?

postgresql - unnest() 函数的有序结果

postgresql - 如何从错误消息中确定 PostgreSQL 错误代码

postgresql - 为什么添加 JOIN 会完全修改查询规划器的行为?

php - 使用 unixOdbc 的 SELECT 之一失败 - SQLSTATE [24000] : Invalid cursor state