Fix SQL error in "Copy table" dialog, in PostgreSQL mode. Use lowercase table and column names in IS.TABLES, so PG can find them. See http://www.heidisql.com/forum.php?t=18847

This commit is contained in:
Ansgar Becker
2015-07-08 16:02:44 +00:00
parent 082368e947
commit 7d661df417

View File

@@ -376,10 +376,10 @@ begin
TargetTable := FConnection.QuotedDbAndTableName(comboDatabase.Text, editNewTablename.Text);
// Watch out if target table exists
TableExistence := FConnection.GetVar('SELECT '+FConnection.QuoteIdent('TABLE_NAME')+
' FROM '+FConnection.QuoteIdent('information_schema')+'.'+FConnection.QuoteIdent('TABLES')+
TableExistence := FConnection.GetVar('SELECT '+FConnection.QuoteIdent('table_name')+
' FROM '+FConnection.QuoteIdent('information_schema')+'.'+FConnection.QuoteIdent('tables')+
' WHERE '+FConnection.QuoteIdent(FConnection.GetSQLSpecifity(spISTableSchemaCol))+'='+FConnection.EscapeString(comboDatabase.Text)+
' AND '+FConnection.QuoteIdent('TABLE_NAME')+'='+FConnection.EscapeString(editNewTablename.Text)
' AND '+FConnection.QuoteIdent('table_name')+'='+FConnection.EscapeString(editNewTablename.Text)
);
if TableExistence <> '' then begin
if MessageDialog(_('Target table exists. Drop it and overwrite?'), mtConfirmation, [mbYes, mbCancel]) = mrCancel then begin