You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

DBeaver中information_schema.columns查询无法运行的问题排查求助

Troubleshooting DBeaver 4.2.0 Information Schema Query Issues & Exporting Column Metadata

Let's break down your problem step by step, since you mentioned the query works in SQL Server tools but fails in DBeaver 4.2.0, and you need to export all column metadata for your database tables.

First: Verify the Query's Correctness

The information_schema.columns view behaves slightly differently across database systems, so let's rule out script issues first:

  • If you're using SQL Server: The table_schema field refers to the schema name (like dbo by default), not the database name. If you intended to filter by database, use table_catalog instead:
    SELECT * FROM information_schema.columns WHERE table_catalog = 'your_database_name';
    
    Double-check that 'schemaname' matches the actual schema your tables are stored in (run SELECT DISTINCT table_schema FROM information_schema.tables; to list available schemas).
  • If you're using MySQL/PostgreSQL: Your original query is syntactically correct—table_schema does refer to the database/schema name here. So the issue is likely with DBeaver itself.

Next: DBeaver 4.2.0 Limitations & Potential Bugs

DBeaver 4.2.0 is a very old version (released back in 2017). Over the years, the DBeaver team has fixed dozens of bugs related to:

  • Compatibility with newer database drivers
  • Parsing and executing information_schema queries
  • Metadata retrieval for various database systems

It's highly probable that your issue stems from an unpatched bug in this outdated version.

Solutions to Fix the Query & Export Your Column Data

Upgrading to the latest stable DBeaver version will almost certainly resolve the query issue, plus you'll get improved export functionality. After upgrading:

  1. Re-run your original (or corrected) query to confirm it returns results.
  2. Once you have the full column list in the results pane, right-click > Export Results and choose your preferred format (Excel, CSV, JSON, etc.).

Option 2: Work Around the Issue Without Upgrading

If you can't upgrade right now:

  • Use database-native metadata queries instead of information_schema:
    • SQL Server: SELECT * FROM sys.columns; (join with sys.tables if you need full table names)
    • MySQL: If your original query fails, try SHOW FULL COLUMNS FROM schemaname.table_name; for individual tables, then combine results manually or via a batch script.
    • PostgreSQL: SELECT * FROM pg_catalog.pg_attribute WHERE attrelid IN (SELECT oid FROM pg_catalog.pg_class WHERE relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = 'schemaname'));
  • Use DBeaver's built-in export tool: Skip writing SQL entirely. Right-click your target schema/database in the left navigation panel > Export Data. In the wizard:
    1. Select "Metadata export" (or choose to export table data with column headers—adjust based on your needs).
    2. Pick your output format and follow the prompts to export all column details for every table.

Final Note

If after verifying the query and upgrading DBeaver the issue persists, it might be a rare edge case bug—but given the age of 4.2.0, upgrading is the most reliable fix.

内容的提问来源于stack exchange,提问作者mbahonen

火山引擎 最新活动