
pgsql
postgresql
flowerspring
要铭记在心:每天都是一年中最美好的日子。
展开
-
wiki osm Osmosis 使用方法记录
https://wiki.openstreetmap.org/wiki/Osmosis?tdsourcetag=s_pcqq_aiomsghttps://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.47Osmosis从一个区域提取高速摄像机的示例:C:\osmosis\bin>osmosis --read-p...原创 2019-08-28 16:47:28 · 1496 阅读 · 0 评论 -
Postgresql查询表和索引空间
--查询表空间planet_t1=# select pg_relation_size('s_ways.ways_road');pg_relation_size------------------ 60497190912(1 row)planet_t1=# select pg_size_pretty(pg_relation_size('s_ways.ways_road'...原创 2020-01-09 14:25:39 · 868 阅读 · 0 评论 -
PostgreSQL函数和运算符(一)
PostgreSQL为内置数据类型提供了大量的函数和运算符。用户也可以定义自己的函数(参考第11章)。在psql中执行命令/df和/do可以分别列出可用的函数和运算符的列表。本章中的大部分函数和运算符都是SQL标准中定义的,也有一部分是PostgreSQL自己扩展的。SQL标准定义了一些有特殊语法的字符串函数,这些函数使用特殊关键字而不是逗号来分隔参数,例如from和for。7.1逻辑运算符常用的逻辑运算符有: AND OR ...转载 2020-06-09 15:59:16 · 1064 阅读 · 0 评论 -
PG数据库中表 索引 所占用空间大小查询
查看所有表所占磁盘空间大小select sum(t.size) from (SELECT table_schema || '.' || table_name AS table_full_name, pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')AS sizeFROM informati...转载 2020-05-07 15:13:01 · 2538 阅读 · 0 评论 -
qsql 查看 当前活动 并终止活动
查看 当前查询selectdatid,pid,datname,query,query_startfrompg_stat_activitywherestate='active'anddatname='local_myanmar';select pg_terminate_backend(pid);原创 2020-04-07 11:25:36 · 174 阅读 · 0 评论 -
postgresql limit offset
limit 单独关键字: 同 mysql sqlserver;limit offset 一起出现:select * from test limit num1 offset num2;从num2 数据开始,取 num1条数据原创 2019-11-14 08:50:10 · 3209 阅读 · 1 评论 -
postgrsql判断字符串是否为1-9的数字
select id,1118,cast( case (tags->'lanes' ~ '^([0-9])$') when true then tags->'lanes' else '0' end as INTEGER) from ways_roadwhere tags->'lanes' is not nullSELECT ruleFROM poo...原创 2019-11-06 16:53:52 · 1645 阅读 · 0 评论 -
PostgreSQL 聚合函数讲解 - 3 总体|样本 方差, 标准方差
https://yq.aliyun.com/articles/147?spm=a2c4e.11153940.blogcont148.23.1526746cjd2A4Y摘要:PostgreSQL自带了一些常用的统计学聚合函数, 非常好用. 本文介绍一下方差和标准差的一些聚合函数. 总体方差 : population covariance 总体标准差 : population standard ...转载 2019-04-30 10:30:49 · 2711 阅读 · 0 评论 -
PostgreSQL 聚合函数讲解 - 2 相关性统计
摘要:PostgreSQL统计信息中, 有一个相关性的统计, 在pg_stats.correlation中可以查看到, 统计值范围从-1到1, 趋向于-1表示逆向相关, 趋向于1表示正向相关, 趋向于0表示不相关.PostgreSQL统计信息中, 有一个相关性的统计, 在pg_stats.correlation中可以查看到, 统计值范围从-1到1, 趋向于-1表示逆向相关, 趋向于1表示...转载 2019-04-30 10:31:24 · 1156 阅读 · 0 评论 -
PostgreSQL 聚合函数讲解 - 1 常用聚合函数
https://yq.aliyun.com/articles/144?spm=a2c4e.11153940.blogcont146.7.47361a0cl2D2te摘要:PostgreSQL支持较多的聚合函数, 以PostgreSQL 9.4为例, 支持例如一般性的聚合, 统计学科的聚合, 排序集聚合, 假象集聚合等. 本文将对一般性聚合函数举例说明其功能和用法. 聚合函数有哪些,见 ...转载 2019-04-30 10:32:11 · 6675 阅读 · 0 评论 -
PostgreSQL 聚合函数讲解 - 5 线性回归
https://yq.aliyun.com/articles/149?spm=a2c4e.11153940.blogcont148.34.28b1746cOTo526摘要:首先讲个线性回归分析linear regression (最小二乘法least-squares-fit)的小故事(取自百度) : 1801年,意大利天文学家朱赛普·皮亚齐发现了第一颗小行星谷神星。首先讲个线性回...转载 2019-04-30 10:34:55 · 2101 阅读 · 0 评论 -
PostgreSQL 聚合函数讲解 - 6 分组排序聚合
PostgreSQL 聚合函数讲解 - 6 分组排序聚合德哥2015-12-14 17:14:00浏览6377评论0PostgreSQL摘要:分组排序聚合的例子. Table 9-51. Ordered-Set Aggregate Functions Function Direct Argument Type(s) Aggregated Argument Type(s) Retu...转载 2019-04-30 10:35:41 · 2256 阅读 · 2 评论 -
PostgreSQL 聚合函数讲解 - 7 窗口反聚合
https://yq.aliyun.com/articles/151?spm=a2c4e.11153940.blogcont150.13.8b2b6dea9KDLzE摘要:聚合函数的最后一个分类,Hypothetical-Set Aggregate Functions. 这类聚合函数还有对应的窗口函数, 首先来看一下对应窗口函数的用法. rank() bigint rank of the ...转载 2019-04-30 10:36:45 · 514 阅读 · 0 评论 -
pgAdmin 导入导出数据
导出表导入表原创 2019-05-07 10:38:34 · 4042 阅读 · 1 评论 -
postgres pgdump 备份还原
备份pg_dump -h 127.0.0.1 -U postgres -d testdb > "C:\Users\honey\Desktop\testdb.bak"pg_dump -h 127.0.0.1 -U postgres -d testdb -f "C:\Users\honey\Desktop\testdb.bak"还原psql -h 127.0.0.1 -U po...原创 2019-05-07 11:07:18 · 257 阅读 · 0 评论 -
postgis 中的距离计算
修正后的语句为 select ST_distance(geom::geography,ST_GeomFromText('POINT(121 32)',4326)::geography) as distance from way_geom_motorway_res where ST_dwithin(geom::geography,ST_GeomFromText('POI...转载 2019-06-28 19:03:58 · 5638 阅读 · 2 评论 -
PostgreSQL的hstore
参考:PostgreSQL的hstore初步学习https://www.cnblogs.com/gaojian/p/3351294.htmlselect id,tags,nodes,linestring from waysselect id,hstore_to_json (tags) json from waysselect id,skeys(tags),avals(tags...原创 2019-09-10 14:45:14 · 470 阅读 · 0 评论 -
PostgreSQL 聚合函数讲解 - 4 总体协方差, 样本协方差
转自https://yq.aliyun.com/articles/148 PostgreSQL摘要:1. 数学期望值, 平均值, mean http://zh.wikipedia.org/wiki/%E6%9C%9F%E6%9C%9B%E5%80%BC 表示: E[X], 即X变量的平均值. 也用miu表示 :μ=E[X] PostgreSQL中举例 : postgres=# se.....转载 2019-04-30 10:28:41 · 3029 阅读 · 0 评论