# Extensions: writing a patch for PostgreSQL

DevFeed: [Extensions: writing a patch for PostgreSQL](<https://devfeed.tech/articles/extensions-writing-a-patch-for-postgresql-34397.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2010/10/extensions-writing-a-patch-for-postgresql/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2010-10-15T09:30:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Git](<https://devfeed.tech/topics/git.md>), [Code](<https://devfeed.tech/topics/code.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [git](<https://devfeed.tech/tags/git.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>)

## AI overview

This article describes developing a PostgreSQL patch related to SQL extensions. It explains that PostgreSQL backend code uses abstractions and memory contexts, and discusses using Git branches and cherry-picking to isolate changes for review. The proposed extension behavior would let backups record an instruction to reinstall an extension instead of including its extension-specific objects.

## Source excerpt

These days, thanks to my community oriented job, I'm working full time on a PostgreSQL patch to terminate basic support for extending SQL. First thing I want to share is that patching the backend code is not as hard as one would think. Second one is that git really is helping. "Not as hard as one would think, are you kidding me?", I hear some say. Well, that's true. It's C code in there, but with a very good layer of abstractions so that you're not dealing with subtle problems that much. Of course it happens that you have to, and managing the memory isn't an option. That said, palloc() and the memory contexts implementation makes that as easy as in lots of cases, you don't have to think about it.