数据库 - 文章列表
-
使用Docker部署带pgvector插件的PostgreSQL:轻松实现向量相似性搜索
在AI与机器学习快速发展的2025年,向量相似性搜索成为关键技术,广泛应用于语义理解与个性化推荐等场景。PostgreSQL通过pgvector插件扩展了向量处理能力,支持高效存储与查询高维向量,兼具SQL生态集成、开源免费及ACID事务支持等优势。文章详细介绍了使用Docker部署PostgreSQL with pgvector的命令及参数解析,并演示了如何启用pgvector插件、创建向量表及执行相似性搜索操作,为开发者提供了完整的向量数据库构建与使用指南。
-
PG数据库给指定用户授予访问指定表的权限
--列出所有用户select*frompg_user--查询用户可以访问哪些表select*frominformation_schema.role_table_grantswheregrantee=xxx;--为用户授予访问表的权限grantselectonv_zc_racktoxxx
-
TNS-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
TNS-12514:TNS:监听程序当前无法识别连接描述符中请求的服务ORA-12514,TNS:listenerdoesnotcurrentlyknowofservicerequestedinconn可以尝试修改listener.ora此文件位于“D:\app\Administrator\virtual\product\12.2.0\dbhome_1\network\admin”增加下图中的红色
-
postgresql新建数据库及用户的方法
#创建数据库testdbcreatedatabasetestdb;#创建用户testusercreateusertestuserwithpassword123456;#授权grantallondatabasetestdbtotestuser;#修改数据库owneralterdatabasetestdbownertotestuser;*切换用户登录#创建schema,命名为schema01creat
-
postgresql查询每张表占用硬盘空间的语句
查询每张表占用磁盘空间SELECTtable_schema||.||table_nameAStable_full_name,pg_size_pretty(pg_total_relation_size(||table_schema||.||table_name||))ASsizeFROMinformation_schema.tablesORDERBYpg_total_relation_size(||
-
postgresql 备份/还原数据库的方法
需要在postgres安装目录的bin目录下执行备份命令:pg_dump-Upostgres-dpostgres-h127.0.0.1-p5432-fD:\dump.sql-s-U用户名-d数据库名称-h服务器ip-p端口-f文件名-s只保存数据结构,需要保存数据则不加该参数还原命令:psql-Upostgres-dpostgres-h127.0.0.1-p5432-fD:\dump.sql
-
centos 上安装psycopg2的方法
centos上安装psycopg2yuminstallpostgresql-develyuminstallpython3-develpip3installpsycopg2
-
python SCRAM authentication requires libpq version 10 or above
python在centos7下连接postgresql数据库报错:pythonSCRAMauthenticationrequireslibpqversion10orabove大概意思是libpg的版本低了,但使用yuminstallpostgresql-devel只能更新到9.2.24版本[参考网址](https://pkgs.org/download/postgresql-devel)安装pos
-
centos中mysql忘记密码的处理方法
1、修改mysql配置文件vi/etc/my.cnf在[mysqld]下面添加skip-grant-tables如下图所示2、保存配置后,重启mysql服务servicemysqldrestart3、修改密码mysql-urootmysqlusemysql;updateuserSETauthentication_string=PASSWORD(xxxxxx)WHEREuser=root;4、将配置
-
oracle 口令已失效 更新oracle口令的方法
用下列语句查询用户名有效期selectusername,account_status,expiry_date,profilefromdba_users;使用下面语句更新用户密码,并让有限期增加密码可以是原来的密码alteruser用户名identifiedby用户密码accountunlock;