Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: validation for postgres version

Kevin Grüneberge03cf0631bd0
diff --git a/studio/pages/new/[slug].tsx b/studio/pages/new/[slug].tsx
index 67305391615..b0c50347f1b 100644
--- a/studio/pages/new/[slug].tsx
+++ b/studio/pages/new/[slug].tsx
@@ -169,6 +169,15 @@ const Wizard: NextPageWithLayout = () => {
kps_enabled: kpsEnabled,
}
if (postgresVersion) {
+ if (!postgresVersion.match(/1[2-9]\..*/)) {
+ setNewProjectLoading(false)
+ ui.setNotification({
+ category: 'error',
+ message: `Invalid Postgres version, should start with a number between 12-19, a dot and additional characters, i.e. 15.2 or 15.2.0-3`,
+ })
+ return
+ }
+
data['custom_supabase_internal_requests'] = {
ami: { search_tags: { 'tag:postgresVersion': postgresVersion } },
}
@@ -310,6 +319,7 @@ const Wizard: NextPageWithLayout = () => {
id="custom-postgres-version"
layout="horizontal"
label="Postgres Version"
+ autoComplete="off"
descriptionText={
<p>
Specify a custom version of Postgres (Defaults to the latest)