• HOME
  • SEARCH
  • TOPICS
  • DATA

  • PostgreSQL 生成 UUID

    uuid 插件 PostgreSQL内置了"uuid-ossp"插件,用于生产UUID。 postgres=# \dx+ uuid-ossp Objects in extension "uui

    2024-06-12, Views: 1202 , Topics: PostgreSQL UUID

  • PostgreSQL 编译安装 ossp-uuid 插件

    编译配置 编译PostgreSQL时指定参数--with-uuid=ossp,如果已经执行过./configure也可以再次执行。 ./configure --prefix=/home/postgr

    2024-06-10, Views: 1833 , Topics: PostgreSQL UUID

  • PostgreSQL 使用 count filter 统计不同条件下的数量

    需求 统计不同年龄段的学生数量:总学生数、年龄6~10岁学生数量(小学)、年龄11~14岁学生数量(初中)、年龄15~17岁学生数量(高中)。 数据准备 create table student (

    2024-06-07, Views: 1847 , Topics: PostgreSQL 统计

  • PostgreSQL group by 后查询出其他字段

    需求 使用聚合函数后,无法select其他字段。 场景 有班级表(id/name)和学生表(id/name/class_id),学生表中有class_id字段关联班级表。 需查询出每个班级学生数量及

    2024-06-06, Views: 1084 , Topics: PostgreSQL

  • PostgreSQL 16 安装 jieba 全文检索插件报错 for loop initial declarations are only allowed in C99 mode

    错误信息 在make阶段抛出错误 root@fendoudebb build]# make Scanning dependencies of target pg_jieba [ 50%] Build

    2024-06-05, Views: 1136 , Topics: PostgreSQL pg_jieba 全文检索

  • PostgreSQL 全文检索安装 pg_jieba 中文插件

    下载 pg_jieba git clone https://github.com/jaiminpan/pg_jieba 初始化 pg_jieba cd pg_jieba 初始化子工程 git s

    2024-06-04, Views: 1429 , Topics: PostgreSQL 全文检索 pg_jieba

  • PostgreSQL psql: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory

    错误信息 执行psql时抛出异常: psql: error while loading shared libraries: libpq.so.5: cannot open shared object

    2024-06-02, Views: 1598 , Topics: PostgreSQL

  • PostgreSQL 强制删除数据库

    需求 删除数据库时提示有其他会话,无法删除,需强制删除数据库。 SQL DROP DATABASE IF EXISTS test_db WITH (FORCE) 文档 https://www.po

    2024-05-31, Views: 1018 , Topics: PostgreSQL

  • Spring Boot MyBatis 将 PostgreSQL 数组转为 Java List

    类型处理器 @MappedJdbcTypes({JdbcType.ARRAY}) @MappedTypes({Object.class}) public class ListTypeHandler

    2024-05-20, Views: 1338 , Topics: MyBatis PostgreSQL Spring Boot

  • Spring Boot MyBatis PostgreSQL Cannot convert the column of type TIMESTAMPTZ to requested type java.time.LocalDateTime

    错误信息 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Req

    2024-04-18, Views: 2756 , Topics: Spring Boot MyBatis PostgreSQL

  • PostgreSQL 16 编译安装

    说明 以CentOS 8为例。 安装依赖 libxslt yum install libxslt-devel readline yum install readline-devel zlib y

    2024-03-15, Views: 1769 , Topics: PostgreSQL

  • PostgreSQL 删除数据库时报错 ERROR: database "test" is being accessed by other users

    错误信息 查询出错 (7): ERROR: database "test" is being accessed by other users DETAIL: T

    2024-03-14, Views: 1116 , Topics: PostgreSQL

  • PostgreSQL 覆盖索引添加额外字段信息

    场景 user表中,有username唯一索引列。 当我们从user表中查找id时,数据库只需一次查询(这里的只查询一次,指的是:数据库内部只从索引就能获取需要

    2023-11-22, Views: 801 , Topics: PostgreSQL

  • PostgreSQL 批量更新

    SQL 使用临时表实现批量更新 UPDATE sys_user SET username = tmp.username FROM (VALUES

    2023-11-21, Views: 1306 , Topics: PostgreSQL

  • PostgreSQL 逻辑删除保证数据唯一

    场景 有用户表(username,del_flag),保证用户名唯一。 方案一 username唯一索引,逻辑删除后不能再新建相同名称的用户。 方案二 user

    2023-11-20, Views: 946 , Topics: PostgreSQL

  • PostgreSQL 数组中是否存在某个元素

    存在 select * from post where 'Java' = ANY(topics_arr); 不存在 select * from post whe

    2023-11-17, Views: 984 , Topics: PostgreSQL

  • PostgreSQL 转义特殊字符

    E'' select E'$\abcd', E'abcd\''; 输出 postgres=# select E'$\abcd', E'abcd\''; ?co

    2023-11-16, Views: 1618 , Topics: PostgreSQL

  • PostgreSQL 查询当前文章以及上一篇文章和下一篇文章

    需求 查询出当前博客文章的上一篇和下一篇文章,显示在当前博客的尾部。 数据准备 create table if not exists article(id in

    2023-11-15, Views: 867 , Topics: PostgreSQL

  • PostgreSQL 实现 upsert 插入或者更新功能

    需求 实现insert or update功能,也称upsert。 即:记录如果不存在就插入,记录如果存在就更新。 语法 使用insert on conflic

    2023-11-14, Views: 1520 , Topics: PostgreSQL

  • PostgreSQL for update skip locked 实现队列功能

    数据准备 create table if not exists queue(id int, content text, status text); insert

    2023-11-13, Views: 1636 , Topics: PostgreSQL

  • First Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next Last

©2025 沪ICP备18012661号-1 阿里云

Messages Sitemap GitHub