pg11: pg_proc, type of function is stored differently from pg11 forward

Followed the more structured approach of pg11 in combining the different types into a kind field
when reading from older versions we migrate the old fields to the new field. Change in 11
is because of PROCEDURE support. However full PROCEDURE support will be its own change and is
registered as issue #37
This commit is contained in:
eelke 2018-12-23 08:48:45 +01:00
parent a88af1ac11
commit 43f8117bbd
3 changed files with 60 additions and 9 deletions

View file

@ -73,7 +73,25 @@ namespace {
return res;
}
}
void operator<<(ProcKind &s, const Pgsql::Value &v)
{
const char *c = v.c_str();
switch (*c) {
case 'f':
s = ProcKind::Function;
break;
case 'p':
s = ProcKind::Procedure;
break;
case 'a':
s = ProcKind::Aggregate;
break;
case 'w':
s = ProcKind::Window;
break;
}
}
void PgProc::setArgs(
@ -239,7 +257,7 @@ QString PgProc::createSql() const
sql += "\n LANGUAGE " % language % " ";
// if (GetConnection()->BackendMinimumVersion(8, 4) && GetIsWindow())
// sql += wxT("WINDOW ");
if (iswindow)
if (isWindow())
sql += "WINDOW ";
// sql += GetVolatility();
sql += volatility();