---
title: "Functions, functions, everywhere?"
publication: "Postgres Weekly"
issue: 567
published_at: "2024-08-28"
canonical_url: "https://postgresweekly.com/issues/567"
---

Plus a look at Postgres malware, and how to create an FDW with WebAssembly. |        

#​567 — August 28, 2024 

[Web Version](https://postgresweekly.com/issues/567)  

Together with [![pgAnalyze\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,e_trim,w_350,h_100/e_make_transparent/co_white,e_outline:7/lhwcvgc1asd4fzaahty4.png)](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklyPrimary08282024)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/mwnjazjyigfrdpwdwtcj.jpg)](https://www.crunchydata.com/blog/six-degrees-of-kevin-bacon-postgres-style)  

[Six Degrees of Kevin Bacon - Postgres Style](https://www.crunchydata.com/blog/six-degrees-of-kevin-bacon-postgres-style) — Given two random actors, could you join those actors within six steps through other actors that have co-starred in movies together? That’s the game of [Six Degrees of Kevin Bacon](https://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon) and Paul sets out to see if Postgres can tackle the task of finding such connections. 

Paul Ramsey   

[Why I Always Use Postgres Functions For Everything](https://medium.com/@vbilopav/why-i-always-use-postgresql-functions-for-everything-aa501a33842a) — There are numerous schools of thought on the roles of functions in production databases, so many of you may disagree with the author. Nonetheless, he explains why he appreciates the encapsulation and abstraction that user defined functions provide. 

Vedran Bilopavlović   [![\](https://copm.s3.amazonaws.com/01bb10d8.png)](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklyPrimary08282024) 

[Free Guide: Boost Postgres Performance by 3x](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklyPrimary08282024) — Drawing from proven practices honed tuning thousands of databases, we walk you through the process to achieve a 3x performance boost in your Postgres databases while reducing disk data load by 500x. 

pganalyze sponsor   

**QUICK BITS:** 

- 🔒 Assaf Morag of Aqua Security takes [a look at a piece of Postgres _malware_ they've discovered.](https://www.aquasec.com/blog/pg_mem-a-malware-hidden-in-the-postgres-processes/)
- The [Neon](https://neon.tech/) serverless Postgres platform has announced general availability of [its autoscaling feature](https://neon.tech/blog/neon-autoscaling-is-generally-available).
- [Tembo](https://tembo.io/) has unveiled [its own Tembo AI platform](https://tembo.io/blog/tembo-ai) in alpha which provides a way to call LLM models via both SQL and HTTP.   

[How to Create a Postgres FDW with WebAssembly](https://fdw.dev/guides/create-wasm-wrapper/) — Foreign data wrappers (FDWs) provide a way to give Postgres powers to query external data sources as if they were local tables. Using the Rust-based [Wrappers](https://github.com/supabase/wrappers) FDW framework, you can create WebAssembly powered FDWs which can be dynamically deployed at runtime. 

Supabase   

[Postgres Webhooks with pgstream](https://xata.io/blog/postgres-webhooks-with-pgstream) — A look at a use case for the [pgstream](https://xata.io/pgstream) change data capture tool: calling webhooks based upon Postgres data and schema changes. 

Tudor Golubenco   

[Understanding pgvector's HNSW Index Storage](https://lantern.dev/blog/pgvector-storage) — [pgvector](https://github.com/pgvector/pgvector) is widely used for implementing vector similarity search features in Postgres, but how are its indexes stored under the hood? 

Varik Matevosyan   

📄 [Why Postgres is a Viable Alternative to Oracle](https://stormatics.tech/blogs/postgresql-is-a-viable-alternative-to-oracle-here-is-why) – I doubt any _Postgres Weekly_ readers need convincing of this, but if you know anyone who does.. Umair Shahid 

📄 [Easy to Overlook Postgres Performance Issues in Ruby on Rails Apps](https://pawelurbanek.com/rails-postgresql-performance) Paweł Urbanek 

📄 [Why Postgres 17's Incremental Backup Feature is a Game-Changer](https://www.enterprisedb.com/blog/why-postgresql-17s-incremental-backup-feature-game-changer) David Wagoner and Tim Boutin 

📄 [Build a Fully Local RAG App with Postgres, Mistral, and Ollama](https://www.timescale.com/blog/build-a-fully-local-rag-app-with-postgresql-mistral-and-ollama/) Haziqa Sajid (Timescale)       

📰 Classifieds   

Discover [PostgreSQL sessions](https://passdatacommunitysummit.com/sessions/?databaseManagementTopic=PostgreSQL&utm_source=email&utm_medium=email&utm_campaign=es-202411-pass-summit-pg-weekly-ad-aug-em-all) and a dedicated Learning Pathway at PASS Data Community Summit, November 4-8, 2024 in Seattle. 

--- 

[Dragonfly (25k GitHub stars)](https://www.dragonflydb.io/?utm_campaign=cooperpress_postgres_aug24&utm_source=cooper_press&utm_medium=email&utm_content=Postgres%20Weekly) is a modern Redis replacement. Organizations that switch to Dragonfly can reduce infrastructure costs by 80%.      

🛠 Code and Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/xozxp0pigqwsvbw14z8v.jpg)](https://www.prisma.io/blog/announcing-typedsql-make-your-raw-sql-queries-type-safe-with-prisma-orm)  

[Prisma 5.19.0: The JS ORM Now with 'Typed SQL'](https://www.prisma.io/blog/announcing-typedsql-make-your-raw-sql-queries-type-safe-with-prisma-orm) — [Prisma](https://www.prisma.io/docs/orm/overview/introduction/what-is-prisma) is a popular [declaratively-driven ORM](https://www.prisma.io/docs/orm/overview/prisma-in-your-stack/is-prisma-an-orm) in the Node.js / TypeScript world and its new version makes it possible to write raw SQL queries in a type-safe way. 

Nikolas Burk   

[pgMonitor: An Open Source Monitoring Extension](https://www.crunchydata.com/blog/announcing-an-open-source-monitoring-extension-for-postgres-with-pgmonitor) — pgMonitor is the name of a Postgres metrics tracking tool Crunchy Data has maintained for years, but it’s now available as an open source extension too. 

Keith Fiske (Crunchy Data)   

- [Barman 3.11.0](https://github.com/EnterpriseDB/barman/releases/tag/release%2F3.11.0) – Backup and disaster recovery tool. Now with support for Postgres 17's incremental backups.
- [Pongo 0.13](https://github.com/event-driven-io/Pongo) – Postgres driver for Node.js that presents as a MongoDB-style API.
- [pg-boss 10.0](https://github.com/timgit/pg-boss/releases/tag/10.0.0) – Postgres-based job queuing system for Node.js.
- [postgres-meta 0.84](https://github.com/supabase/postgres-meta) – A RESTful API for managing Postgres.
- [pgrx 0.12](https://github.com/pgcentralfoundation/pgrx/releases/tag/v0.12.0) – A way to build Postgres extensions with Rust.
- [pgModeler 1.1.4](https://pgmodeler.io/) – Visual data modelling tool.
- [pgAdmin 4 v8.11](https://www.postgresql.org/about/news/pgadmin-4-v811-released-2916/)    

**Got a new email?** You can [change your address here](https://postgresweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Postgres Weekly](https://postgresweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. _Thanks!_ 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada. 

[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*).
