Skip to content

Instantly share code, notes, and snippets.

View rallisf1's full-sized avatar

John Rallis rallisf1

  • Athens, Greece
View GitHub Profile
@rallisf1
rallisf1 / slugify.sql
Last active August 11, 2023 21:46 — forked from kez/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent";
CREATE OR REPLACE FUNCTION slugify(t text) RETURNS text
AS $$
BEGIN
t := lower(t);
-- german
t := replace(t, 'ä', 'ae');
t := replace(t, 'ö', 'oe');
t := replace(t, 'ü', 'ue');