mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
fix issue #47
1. Добавлена проверка пустого имени файла перед удалением (frmRestore). 2. Проблема в неверном втором аргументе функции pg_get_expr. При наличи сложного DEFUALT выражения для колонки выводилось ошибка при выполнении функции. Исправлено в dlgSearchObject, frmEditGrid, ShowDependencies.
This commit is contained in:
parent
9813de8597
commit
7f54463cec
5 changed files with 5 additions and 5 deletions
|
|
@ -556,7 +556,7 @@ void dlgSearchObject::OnSearch(wxCommandEvent &ev)
|
|||
wxT("inner join pg_class t on a.attrelid = t.oid and t.relkind in ('r','v','m') ")
|
||||
wxT("left join pg_namespace n on t.relnamespace = n.oid ")
|
||||
wxT("where a.attnum > 0 ")
|
||||
wxT(" and (ty.typname ilike ") + txtPatternStr + wxT(" or pg_get_expr(ad.adbin,0) ilike ") + txtPatternStr + wxT(") ")
|
||||
wxT(" and (ty.typname ilike ") + txtPatternStr + wxT(" or pg_get_expr(ad.adbin,ad.adrelid) ilike ") + txtPatternStr + wxT(") ")
|
||||
wxT("UNION ") // View's definition
|
||||
wxT("SELECT 'Views', c.relname, ")
|
||||
wxT("':Schemas/' || n.nspname || '/:Views/' || c.relname, n.nspname ")
|
||||
|
|
|
|||
|
|
@ -2328,7 +2328,7 @@ sqlTable::sqlTable(pgConn *conn, pgQueryThread *_thread, const wxString &tabName
|
|||
|
||||
pgSet *colSet = connection->ExecuteSet(
|
||||
wxT("SELECT n.nspname AS nspname, relname, format_type(t.oid,NULL) AS typname, format_type(t.oid, att.atttypmod) AS displaytypname, ")
|
||||
wxT("nt.nspname AS typnspname, attname, attnum, COALESCE(b.oid, t.oid) AS basetype, atthasdef, pg_get_expr(def.adbin,0) AS adsrc,\n")
|
||||
wxT("nt.nspname AS typnspname, attname, attnum, COALESCE(b.oid, t.oid) AS basetype, atthasdef, pg_get_expr(def.adbin,def.adrelid) AS adsrc,\n")
|
||||
wxT(" CASE WHEN t.typbasetype::oid=0 THEN att.atttypmod else t.typtypmod END AS typmod,\n")
|
||||
wxT(" CASE WHEN t.typbasetype::oid=0 THEN att.attlen else t.typlen END AS typlen\n")
|
||||
wxT(" FROM pg_attribute att\n")
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ void frmRestore::OnEndProcess(wxProcessEvent &ev)
|
|||
}
|
||||
else
|
||||
{
|
||||
wxRemoveFile(restoreTOCFilename);
|
||||
if (!restoreTOCFilename.IsEmpty()) wxRemoveFile(restoreTOCFilename);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -664,7 +664,7 @@ void pgObject::ShowDependencies(frmMain *form, ctlListView *Dependencies, const
|
|||
* END
|
||||
*/
|
||||
ShowDependency(GetDatabase(), Dependencies,
|
||||
wxT("SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, pg_get_expr(ad.adbin,0) adsrc, \n")
|
||||
wxT("SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, pg_get_expr(ad.adbin,ad.adrelid) adsrc, \n")
|
||||
wxT(" CASE WHEN cl.relkind IS NOT NULL THEN cl.relkind::text || COALESCE(dep.refobjsubid::text, '')\n")
|
||||
wxT(" WHEN tg.oid IS NOT NULL THEN 'T'::text\n")
|
||||
wxT(" WHEN ty.oid IS NOT NULL THEN 'y'::text\n")
|
||||
|
|
@ -837,7 +837,7 @@ void pgObject::ShowDependents(frmMain* form, ctlListView* referencedBy, const wx
|
|||
* END
|
||||
*/
|
||||
ShowDependency(GetDatabase(), referencedBy,
|
||||
wxT("SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, pg_get_expr(ad.adbin,0) adsrc, \n")
|
||||
wxT("SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, pg_get_expr(ad.adbin,ad.adrelid) adsrc, \n")
|
||||
wxT(" CASE WHEN cl.relkind IS NOT NULL THEN cl.relkind::text || COALESCE(dep.objsubid::text, '')\n")
|
||||
wxT(" WHEN tg.oid IS NOT NULL THEN 'T'::text\n")
|
||||
wxT(" WHEN ty.oid IS NOT NULL THEN 'y'::text\n")
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue