CREATE EXTENSION.
Extension availability
Extensions marked Always enabled are part of Neki’s managed configuration and cannot be toggled. Other extensions can use either of these workflows:- A checkbox enables server configuration that the extension needs, such as a preload setting. Changing it creates a configuration-profile change.
- An extension without a checkbox does not require a profile-level toggle. You
install it in a logical database with
CREATE EXTENSIONwhen it is available.
CREATE EXTENSION
installs objects in the logical database to which you are connected.
Enable an extension for a profile
You must have permission to update the database, and the branch must be ready.1
From the PlanetScale dashboard, select your Neki database and branch.
2
Open Clusters and select the configuration profile used by the target shards.
3
Select the Extensions tab.
4
Enable the extension. If the extension exposes parameters, review and update them.
5
Select Apply now for any parameter changes.
6
Open Changes and wait for the configuration change to finish before using the extension.
pscale branch config-profile extensions. Enable or disable a catalog
extension that the profile marks as enablable with
pscale branch config-profile extensions enable or
pscale branch config-profile extensions disable.
Install an extension in a logical database
After any required profile change has completed, connect to the target logical database with its default role. When the extension’s instructions require database installation, run:extension_name with the extension you want to install. Repeat
the command for each logical database that needs the extension.
To see extensions that are installed in the current logical database:
Supported extensions
Always enabled
These extensions are part of Neki’s managed configuration and cannot be disabled.Built-in PostgreSQL extensions
These modules ship with PostgreSQL. They do not need a configuration-profile checkbox. Install each one in the logical databases that need it:Community extensions
Extension-specific caveats
Neki can use an extension without implementing every function, cast, or cross-shard query shape that Postgres accepts on a single node. Prefer the working forms below. A rejected shape often returnsNK013 for an
unimplemented input, receive, or user-defined function.
pgvector
Install pgvector after you enable it on the configuration profile:vector, halfvec, sparsevec, and binary
vectors, including HNSW and IVFFlat indexes. Tenant-scoped, shard-targeted, and
cross-shard searches work. You can project the distance and order by the alias,
or repeat the distance expression in ORDER BY:
ORDER BY, and ordering by an alias, both work for
cosine (<=>), inner product (<#>), and L1 (<+>) on vector, halfvec,
and sparsevec. Hamming (<~>) and Jaccard (<%>) work the same way on
bit.
These also work on a sharded table:
- A prepared parameter declared as
vector, and atextparameter cast with$1::vector. ARRAY[1,0,0]::vectorand a vector literal such as'[1,0,0]'::vector. Cast the literal when the distance is in the select list. An uncastembedding <-> '[1,0,0]'there fails withoperator does not exist: vector <-> text, for every distance operator. The uncast form resolves inORDER BYandWHERE.- Global
avg(vector)andsum(vector). The router scatters and combines the aggregate. Tenant-scoped and direct-shard aggregates work too. INSERT ... SELECTof vector values, including a statement that reads more than one shard.
l2_norm(embedding) is ambiguous (42725) even when the column type is
vector. IVFFlat recall is poor at the default ivfflat.probes=1. Raise
probes when you need higher recall. HNSW recall depends on hnsw.ef_search.
vectorscale
vectorscale adds StreamingDiskANN indexes on top of pgvector. Enable and installvector
first, then:
ORDER BY distance shape.
Enabling vectorscale on the Extensions tab exposes these DiskANN query parameters:
Change extension parameters
Parameters associated with an extension appear beneath it after the extension is enabled. Their valid values, defaults, and restart requirements are shown in the dashboard. Updating them creates the same kind of configuration-profile change as other configuration parameters.Disable or remove an extension
Disabling a profile-level extension setting does not runDROP EXTENSION and
does not remove database objects from logical databases. Before disabling it,
remove or migrate any database objects and application features that depend on
it according to that extension’s instructions.
DROP EXTENSION is a separate Postgres operation and can remove dependent
objects. Review the objects that depend on an extension before running it.

