Yes, that is a possibility, but this can already be queried into a
:-variable, so it is less indispensable.
can you show some examples, please?
SELECT COUNT(*) AS has_unit_extension
FROM pg_extension WHERE extname='unit' \gset
\if ! :hash_unit_extension
CREATE TABLE foo(id SERIAL, stuff UNIT);
\echo "unit extension is not loaded"
Ok, for this example one may try:
CREATE EXTENSION IF NOT EXISTS unit;
Or use the "ON_ERROR_STOP" setting, but that is the idea, SQL can be used
to test anything server-side.
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: