You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to nest dollar-quoted string constants by choosing different tags at each nesting level. This is most commonly used in writing function definitions. For example:
$function$
BEGIN
RETURN ($1 ~ $q$[\t\r\n\v\\]$q$);
END;
$function$
Create or replaceFUNCTIONfff(p1 int)
returns void
LANGUAGE plpgsql
AS
$$ --<< outer level quote
DECLARE
v_Qry VARCHAR(4000);
BEGIN
v_Qry := format(
$string$ --<< quote for the string constant passed to the format functionCreate or replaceFUNCTIONfff_DYNAMIC_SQL()
returns void
LANGUAGE plpgsql
AS
$f1$ --<< quoting inside the actual function body
DECLARE
v1 INTEGER;
begin
v1 := %s;
RETURN;
END;
$f1$
$string$, p1);
EXECUTE v_Qry;
RETURN;
END;
$$;
The following snippet demonstrates turning off the variable substitution altogether...
var builder =
DeployChanges.To
.PostgresqlDatabase(connectionString)
.WithScriptsEmbeddedInAssembly(Assembly ?? AppInfo.AppAssembly)
.JournalToPostgresqlTable("public", "versionTable");
// This line should substitute an instance of the ScriptExecutor that doesn't do variable substitution
builder.Configure(c => c.ScriptExecutor = new PostgresqlScriptExecutor(() => c.ConnectionManager, () => c.Log, null, () => false, c.ScriptPreprocessors, () => c.Journal));
var upgrader = builder.Build();
source
source
The text was updated successfully, but these errors were encountered: