1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 00:54:08 +02:00

PostgreSQL: Export functions

This commit is contained in:
Jakub Vrana
2025-02-23 18:28:33 +01:00
parent 6d59ed6d7e
commit 08060f3253
3 changed files with 11 additions and 12 deletions

View File

@@ -521,13 +521,13 @@ function create_routine($routine, $row) {
$set[] = (preg_match("~^($inout)\$~", $field["inout"]) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
}
}
$definition = rtrim("\n$row[definition]", ";");
$definition = rtrim($row["definition"], ";");
return "CREATE $routine "
. idf_escape(trim($row["name"]))
. " (" . implode(", ", $set) . ")"
. (isset($_GET["function"]) ? " RETURNS" . process_type($row["returns"], "CHARACTER SET") : "")
. ($routine == "FUNCTION" ? " RETURNS" . process_type($row["returns"], "CHARACTER SET") : "")
. ($row["language"] ? " LANGUAGE $row[language]" : "")
. ($jush == "pgsql" ? " AS " . q($definition) : "$definition;")
. ($jush == "pgsql" ? " AS " . q($definition) : "\n$definition;")
;
}