<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; datlastsysoid</title>
	<atom:link href="https://www.xifenfei.com/tag/datlastsysoid/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sun, 25 Oct 2026 13:02:42 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Navicat连接postgresql时出现column &#8220;datlastsysoid&#8221; does not exist错误解决</title>
		<link>https://www.xifenfei.com/2025/03/navicat-postgresql-datlastsysoid.html</link>
		<comments>https://www.xifenfei.com/2025/03/navicat-postgresql-datlastsysoid.html#comments</comments>
		<pubDate>Sat, 08 Mar 2025 03:19:33 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[datlastsysoid]]></category>
		<category><![CDATA[Navicat访问postgresql]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=11301</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2025/03/navicat-postgresql-datlastsysoid.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2025/03/navicat-postgresql-datlastsysoid.html" target="_blank">Navicat连接postgresql时出现column &#8220;datlastsysoid&#8221; does not exist错误解决</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>使用Navicat Premium 15访问PostgreSQL 16版本的库,报如下错误</p>
<pre class="brush: bash; title: ; notranslate">
ERROR:  column &quot;datlastsysoid&quot; does not exist
LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database;
</pre>
<p><img src="https://www.xifenfei.com/wp-content/uploads/2025/03/QQ20250308-105201.png" alt="QQ20250308-105201" width="745" height="422" class="alignleft size-full wp-image-11302" /><br />
<img src="https://www.xifenfei.com/wp-content/uploads/2025/03/QQ20250308-105222.png" alt="QQ20250308-105222" width="586" height="317" class="alignleft size-full wp-image-11303" /></p>
<hr />
登录pg库查看</p>
<pre class="brush: sql; title: ; notranslate">
postgres=# SELECT DISTINCT datlastsysoid FROM pg_database;
2025-03-07 22:09:03.569 EST [62553] ERROR:  column &quot;datlastsysoid&quot; does not exist at character 17
2025-03-07 22:09:03.569 EST [62553] STATEMENT:  SELECT DISTINCT datlastsysoid FROM pg_database;
ERROR:  column &quot;datlastsysoid&quot; does not exist
LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database;
                        ^
postgres=# \d pg_database;
               Table &quot;pg_catalog.pg_database&quot;
     Column     |   Type    | Collation | Nullable | Default 
----------------+-----------+-----------+----------+---------
 oid            | oid       |           | not null | 
 datname        | name      |           | not null | 
 datdba         | oid       |           | not null | 
 encoding       | integer   |           | not null | 
 datlocprovider | &quot;char&quot;    |           | not null | 
 datistemplate  | boolean   |           | not null | 
 datallowconn   | boolean   |           | not null | 
 datconnlimit   | integer   |           | not null | 
 datfrozenxid   | xid       |           | not null | 
 datminmxid     | xid       |           | not null | 
 dattablespace  | oid       |           | not null | 
 datcollate     | text      | C         | not null | 
 datctype       | text      | C         | not null | 
 daticulocale   | text      | C         |          | 
 daticurules    | text      | C         |          | 
 datcollversion | text      | C         |          | 
 datacl         | aclitem[] |           |          | 
Indexes:
    &quot;pg_database_oid_index&quot; PRIMARY KEY, btree (oid), tablespace &quot;pg_global&quot;
    &quot;pg_database_datname_index&quot; UNIQUE CONSTRAINT, btree (datname), tablespace &quot;pg_global&quot;
Tablespace: &quot;pg_global&quot;
</pre>
<p>确认没有了datlastsysoid列,通过查看文档确认从Postgres 15版本开始 pg_database表中删除了 datlastsysoid,但是可以通过查询dattablespace替代,使用二进制工具修改libcc.dll文件中的SELECT DISTINCT datlastsysoid部分语句为:SELECT DISTINCT dattablespace<br />
<img src="https://www.xifenfei.com/wp-content/uploads/2025/03/QQ20250308-105427.png" alt="QQ20250308-105427" width="665" height="156" class="alignleft size-full wp-image-11304" /><br />
<img src="https://www.xifenfei.com/wp-content/uploads/2025/03/QQ20250308-105455.png" alt="QQ20250308-105455" width="643" height="169" class="alignleft size-full wp-image-11305" /><br />
<hr />
然后重新启动Navicat，访问pg库正常<br />
<img src="https://www.xifenfei.com/wp-content/uploads/2025/03/QQ20250308-111555.png" alt="QQ20250308-111555" width="459" height="227" class="alignleft size-full wp-image-11306" /><br />
<hr />
当然这个问题如果使用高版本的Navicat或者访问低版本的PostgreSQL库不会出现</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/08/pg-tablespace-database-schema.html" rel="bookmark" class="crp_title">PostgreSQL的表空间、数据库、用户之间的关系</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/01/hgdb-rm-rf-recovery.html" rel="bookmark" class="crp_title">记录一次国产数据库被rm -rf /*删除的救援过程</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/12/sql-bak-0-lost-data.html" rel="bookmark" class="crp_title">模拟sql server故障备份完成恢复实现数据0丢失</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/10/linux7-8-single-user.html" rel="bookmark" class="crp_title">redhat系列7/8进入单用户模式</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/12/ufs-recovery-lvm.html" rel="bookmark" class="crp_title">linux异常磁盘lvm恢复操作演示</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/05/linux-oracle-babyk-source.html" rel="bookmark" class="crp_title">linux环境oracle数据库被文件系统勒索加密为.babyk扩展名溯源</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/01/fio-disk-destruction-recovery.html" rel="bookmark" class="crp_title">fio测试io,导致磁盘文件系统损坏故障恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/01/ar8mswin1256.html" rel="bookmark" class="crp_title">中文环境显示AR8MSWIN1256（阿拉伯语字符集）</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/11/prvg-11975.html" rel="bookmark" class="crp_title">PRVG-11975 : The I/O scheduler parameter of device &#8220;/dev/sdm&#8221; did not match the expected value on nodes</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/02/sql-server-recovering.html" rel="bookmark" class="crp_title">sql server数据库“正在恢复”故障处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/10/grubx64-efi-not-found.html" rel="bookmark" class="crp_title">Failed to open \EFI\redhat\grubx64.efi &#8211; Not Found 故障处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/03/aix-disk-had-oracle-recovery.html" rel="bookmark" class="crp_title">aix磁盘损坏oracle数据库恢复</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2025/03/navicat-postgresql-datlastsysoid.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
