mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00

Previously we would only purge based on URLs, but some of the upcoming new work requires arbitrary expression purging. NOTE! Require the creation of the new SQL procecure in the database, either from varnish.sql or varnish_local.sql depending on if it's prod or dev.
21 lines
387 B
PL/PgSQL
21 lines
387 B
PL/PgSQL
BEGIN;
|
|
|
|
--
|
|
-- "cheating" version of the varnish_purge() function
|
|
-- that can be used on a local installation that doesn't
|
|
-- have any frontends.
|
|
--
|
|
|
|
CREATE OR REPLACE FUNCTION varnish_purge(url text)
|
|
RETURNS bigint
|
|
AS $$
|
|
SELECT 1::bigint;
|
|
$$ LANGUAGE 'sql';
|
|
|
|
CREATE OR REPLACE FUNCTION varnish_purge_expr(url text)
|
|
RETURNS bigint
|
|
AS $$
|
|
SELECT 1::bigint;
|
|
$$ LANGUAGE 'sql';
|
|
|
|
COMMIT; |