# Function Pipelines : PostgreSQL에 함수형 프로그래밍 추가하기

> Clean Markdown view of GeekNews topic #5229. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=5229](https://news.hada.io/topic?id=5229)
- GeekNews Markdown: [https://news.hada.io/topic/5229.md](https://news.hada.io/topic/5229.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2021-10-21T09:04:34+09:00
- Updated: 2021-10-21T09:04:34+09:00
- Original source: [blog.timescale.com](https://blog.timescale.com/blog/function-pipelines-building-functional-programming-into-postgresql-using-custom-operators/)
- Points: 6
- Comments: 0

## Topic Body

- SQL을 이용한 데이터 분석을 훨씬 더 편하게

- Postgres의 "커스텀 데이터타입/연산자/함수"를 이용해서 SQL에 함수형 프로그래밍 컨셉을 도입

ㅤ→ Pandas, PromQL 과 비슷

- Postgres의 SQL문법을 수정하지 않고 그대로 사용하여, 기존 Postgres와 연동하는 도구들과 완벽 호환

SELECT device_id,

ㅤㅤtimevector(ts, val) -> sort() -> delta() -> abs() -> sum()

ㅤㅤㅤㅤas volatility

FROM measurements

WHERE ts >= now()-'1 day'::interval

GROUP BY device_id;

## Comments



_No public comments on this page._
