@@ -272,10 +272,10 @@ def gzip_then_base64_encode(s: str) -> str:
272
272
- {{path: /etc/gotrue.env, content: { gzip_then_base64_encode (gotrue_env_content )} , permissions: '0664', encoding: gz+b64}}
273
273
- {{path: /etc/wal-g/config.json, content: { gzip_then_base64_encode (walg_config_json_content )} , permissions: '0664', owner: 'wal-g:wal-g', encoding: gz+b64}}
274
274
- {{path: /tmp/init.json, content: { gzip_then_base64_encode (init_json_content )} , permissions: '0600', encoding: gz+b64}}
275
- - {{path: /root/pg_extensions.json, content: { gzip_then_base64_encode ('{"pg_cron":"1.3.1"}' )} , permissions: '0644', encoding: gz+b64}}
276
275
runcmd:
277
276
- 'sudo echo \" pgbouncer\" \" postgres\" >> /etc/pgbouncer/userlist.txt'
278
277
- 'cd /tmp && aws s3 cp --region ap-southeast-1 s3://init-scripts-staging/project/init.sh .'
278
+ - 'if [ "$POSTGRES_MAJOR_VERSION" = "15" ]; then echo \' { "pg_cron" :"1.3.1"} \' | sudo tee /root/pg_extensions.json && sudo chmod 644 /root/pg_extensions.json; fi'
279
279
- 'bash init.sh "staging"'
280
280
- 'touch /var/lib/init-complete'
281
281
- 'rm -rf /tmp/*'
@@ -511,6 +511,11 @@ def test_postgrest_ending_empty_key_query_parameter_is_removed(host):
511
511
512
512
513
513
def test_pg_cron_extension (host ):
514
+ # Only run this test for PostgreSQL 15
515
+ postgres_version = os .environ .get ("POSTGRES_MAJOR_VERSION" )
516
+ if postgres_version != "15" :
517
+ pytest .skip (f"Skipping pg_cron test for PostgreSQL version { postgres_version } " )
518
+
514
519
# Connect as supabase_admin and create the extension
515
520
with host .sudo ("postgres" ):
516
521
result = host .run ('psql -U supabase_admin -d postgres -c "CREATE EXTENSION pg_cron WITH SCHEMA pg_catalog VERSION \' 1.3.1\' ;"' )
0 commit comments