|
| 1 | +Level: WARN |
| 2 | + |
| 3 | +### Rationale |
| 4 | + |
| 5 | +Keeping PostgreSQL extensions up to date is important for maintaining database security and stability. Extension developers regularly release updates that include: |
| 6 | + |
| 7 | +- **Security patches** that fix known vulnerabilities |
| 8 | +- **Bug fixes** that resolve functional issues |
| 9 | +- **Performance improvements** that optimize database operations |
| 10 | + |
| 11 | +Using outdated extension versions can expose your database to security risks and prevent you from benefiting from the latest improvements. Additionally, Supabase's Service Level Agreement (SLA) for issues resulting from extensions only applies to the default (recommended) version of each extension. |
| 12 | + |
| 13 | +### Why Keep Extensions Updated? |
| 14 | + |
| 15 | +**Security**: Outdated extensions may contain known security vulnerabilities that have been patched in newer versions. These vulnerabilities could potentially be exploited by malicious actors. |
| 16 | + |
| 17 | +**Support**: Supabase provides support and SLA coverage only for the default (recommended) versions of extensions. Running outdated versions may result in limited support options if issues arise. |
| 18 | + |
| 19 | +**Consistency**: Maintaining consistent extension versions across all projects helps ensure predictable behavior and reduces compatibility issues. |
| 20 | + |
| 21 | +**Performance**: Newer versions frequently include performance optimizations and improvements that can benefit your database operations. |
| 22 | + |
| 23 | +### Warning |
| 24 | + |
| 25 | +- Always test extension updates in a development environment before applying them to production |
| 26 | +- Some extension updates may include breaking changes, so review the extension's changelog before updating |
| 27 | +- Back up your database before performing extension updates |
| 28 | + |
| 29 | +### How to Resolve |
| 30 | + |
| 31 | +To update an extension to its default (recommended) version, use the `ALTER EXTENSION` command: |
| 32 | + |
| 33 | +```sql |
| 34 | +ALTER EXTENSION extension_name UPDATE; |
| 35 | +``` |
| 36 | + |
| 37 | +For example, to update the `uuid-ossp` extension: |
| 38 | + |
| 39 | +First, check the version of the extension taht is installed: |
| 40 | + |
| 41 | +```sql |
| 42 | +-- Check current extension version |
| 43 | +SELECT name, installed_version, default_version |
| 44 | +FROM pg_available_extensions |
| 45 | +WHERE name = 'uuid-ossp'; |
| 46 | +``` |
| 47 | + |
| 48 | +This could return: |
| 49 | +``` |
| 50 | + name | installed_version | default_version |
| 51 | +-------------+-------------------+----------------- |
| 52 | + uuid-ossp | 1.0 | 1.1 |
| 53 | +``` |
| 54 | + |
| 55 | +To update to the installed version: |
| 56 | + |
| 57 | +```sql |
| 58 | +ALTER EXTENSION "uuid-ossp" UPDATE; |
| 59 | +``` |
| 60 | + |
| 61 | +After updating, verify the installed version matches default: |
| 62 | + |
| 63 | +```sql |
| 64 | +SELECT name, installed_version, default_version |
| 65 | +FROM pg_available_extensions |
| 66 | +WHERE name = 'uuid-ossp'; |
| 67 | +``` |
| 68 | + |
| 69 | +Should now return: |
| 70 | +``` |
| 71 | + name | installed_version | default_version |
| 72 | +-------------+-------------------+----------------- |
| 73 | + uuid-ossp | 1.1 | 1.1 |
| 74 | +``` |
0 commit comments