class PostgreSqlDialect extends AbstractHelperDialect {

    @Override
    public Object processPageParameter(MappedStatement ms, Map<String, Object> paramMap, Page page, BoundSql boundSql, CacheKey pageKey) {
        paramMap.put(PAGEPARAMETER_SECOND, page.getPageSize());
        paramMap.put(PAGEPARAMETER_FIRST, page.getStartRow());
        //处理pageKey
        pageKey.update(page.getPageSize());
        pageKey.update(page.getStartRow());
        //处理参数配置
        if (boundSql.getParameterMappings() != null) {
            List<ParameterMapping> newParameterMappings = new ArrayList<ParameterMapping>(boundSql.getParameterMappings());
            if (page.getStartRow() == 0) {
                newParameterMappings.add(new ParameterMapping.Builder(ms.getConfiguration(), PAGEPARAMETER_SECOND, int.class).build());
            } else {
                newParameterMappings.add(new ParameterMapping.Builder(ms.getConfiguration(), PAGEPARAMETER_SECOND, int.class).build());
                newParameterMappings.add(new ParameterMapping.Builder(ms.getConfiguration(), PAGEPARAMETER_FIRST, long.class).build());
            }
            MetaObject metaObject = MetaObjectUtil.forObject(boundSql);
            metaObject.setValue("parameterMappings", newParameterMappings);
        }
        return paramMap;
    }

    /**
     * 构建 <a href="https://www.postgresql.org/docs/current/queries-limit.html">PostgreSQL</a>分页查询语句
     */
    @Override
    public String getPageSql(String sql, Page page, CacheKey pageKey) {<FILL_FUNCTION_BODY>}

}

        StringBuilder sqlStr = new StringBuilder(sql.length() + 17);
        sqlStr.append(sql);
        if (page.getStartRow() == 0) {
            sqlStr.append(" LIMIT ?");
        } else {
            sqlStr.append(" LIMIT ? OFFSET ?");
        }
        return sqlStr.toString();
    
<methods>public non-sealed void <init>() ,public void afterAll() ,public boolean afterCount(long, java.lang.Object, org.apache.ibatis.session.RowBounds) ,public java.lang.Object afterPage(List#RAW, java.lang.Object, org.apache.ibatis.session.RowBounds) ,public boolean beforeCount(org.apache.ibatis.mapping.MappedStatement, java.lang.Object, org.apache.ibatis.session.RowBounds) ,public boolean beforePage(org.apache.ibatis.mapping.MappedStatement, java.lang.Object, org.apache.ibatis.session.RowBounds) ,public java.lang.String getCountSql(org.apache.ibatis.mapping.MappedStatement, org.apache.ibatis.mapping.BoundSql, java.lang.Object, org.apache.ibatis.session.RowBounds, org.apache.ibatis.cache.CacheKey) ,public Page<T> getLocalPage() ,public java.lang.String getPageSql(org.apache.ibatis.mapping.MappedStatement, org.apache.ibatis.mapping.BoundSql, java.lang.Object, org.apache.ibatis.session.RowBounds, org.apache.ibatis.cache.CacheKey) ,public abstract java.lang.String getPageSql(java.lang.String, Page#RAW, org.apache.ibatis.cache.CacheKey) ,public abstract java.lang.Object processPageParameter(org.apache.ibatis.mapping.MappedStatement, Map<java.lang.String,java.lang.Object>, Page#RAW, org.apache.ibatis.mapping.BoundSql, org.apache.ibatis.cache.CacheKey) ,public java.lang.Object processParameterObject(org.apache.ibatis.mapping.MappedStatement, java.lang.Object, org.apache.ibatis.mapping.BoundSql, org.apache.ibatis.cache.CacheKey) ,public void setProperties(java.util.Properties) ,public final boolean skip(org.apache.ibatis.mapping.MappedStatement, java.lang.Object, org.apache.ibatis.session.RowBounds) <variables>