Re: How does Postgres support backwards compatibility

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Josh Innis <joshinnis(at)gmail(dot)com>, pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: How does Postgres support backwards compatibility
Date: 2022-02-09 15:08:45
Message-ID: b8cdd98b763215382197eaf4ab90e24ee0873768.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, 2022-02-08 at 10:50 -0800, Josh Innis wrote:
> I work on an extension for Postgres. We originally developed the extension for Postgres 11.
> Now we are looking into supporting newer versions of Postgres. We would like our extension
> to be compatible with multiple versions of Postgres. Is there a document that explains how
> the Postgres community handles releases and supports older versions? Any information on how
> Postgres handles this will give us guidance on how to best approach this subject.

PostgreSQL won't break APIs wantonly, but particularly with server internal functions
this happens occasionally.

So it depends a lot on what your extension does. If it is written in SQL, the odds
are good that it will just continue working. If it is written in C and you use a lot
of server functions, chances are that you will have to decorate your code with conditional
directives like

#if PG_VERSION_NUM < 130000
...
#else
...
#endif

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jean Baro 2022-02-11 18:56:03 Best practices for preparing an application to (possibly) be sharded (FDW) in the future?
Previous Message Josh Innis 2022-02-08 19:14:44 Re: How does Postgres support backwards compatibility