mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Prefer pg_catalog tables in TDBConnection.GetCreateCode. See http://www.heidisql.com/forum.php?t=16213#p16685
This commit is contained in:
@@ -2611,13 +2611,23 @@ begin
|
||||
end;
|
||||
|
||||
lntView: begin
|
||||
Result := GetVar('SELECT VIEW_DEFINITION'+
|
||||
' FROM INFORMATION_SCHEMA.VIEWS'+
|
||||
' WHERE TABLE_NAME='+EscapeString(Name)+
|
||||
' AND '+SchemaClauseIS('TABLE')
|
||||
);
|
||||
if FParameters.NetTypeGroup = ngPgSQL then
|
||||
Result := 'CREATE VIEW ' + QuoteIdent(Name) + ' AS ' + Result;
|
||||
case FParameters.NetTypeGroup of
|
||||
ngPgSQL: begin
|
||||
// Prefer pg_catalog tables. See http://www.heidisql.com/forum.php?t=16213#p16685
|
||||
Result := 'CREATE VIEW ' + QuoteIdent(Name) + ' AS ' + GetVar('SELECT '+QuoteIdent('definition')+
|
||||
' FROM '+QuoteIdent('pg_views')+
|
||||
' WHERE '+QuoteIdent('viewname')+'='+EscapeString(Name)+
|
||||
' AND '+QuoteIdent('schemaname')+'='+EscapeString(Schema)
|
||||
);
|
||||
end;
|
||||
else begin
|
||||
Result := GetVar('SELECT VIEW_DEFINITION'+
|
||||
' FROM INFORMATION_SCHEMA.VIEWS'+
|
||||
' WHERE TABLE_NAME='+EscapeString(Name)+
|
||||
' AND '+SchemaClauseIS('TABLE')
|
||||
);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
lntFunction: begin
|
||||
|
||||
Reference in New Issue
Block a user