Attachment "tdbcpostgres.c.diff" to
ticket [f5029c0ce6]
added by
holgerjakobs
2023-01-22 08:14:47.
Index: generic/tdbcpostgres.c
==================================================================
--- generic/tdbcpostgres.c
+++ generic/tdbcpostgres.c
@@ -1474,11 +1474,11 @@
char* columnName; /* Name of the column */
Oid typeOid; /* Oid of column type */
Tcl_Obj* retval; /* List of table names */
Tcl_Obj* attrs; /* Attributes of the column */
Tcl_Obj* name; /* Name of a column */
- Tcl_Obj* sqlQuery = Tcl_NewStringObj("SELECT * FROM ", -1);
+ Tcl_Obj* sqlQuery = Tcl_NewStringObj("SELECT * FROM \"", -1);
/* Query used */
(void)dummy;
Tcl_IncrRefCount(sqlQuery);
@@ -1490,10 +1490,11 @@
}
/* Check if table exists by retreiving one row.
* The result wille be later used to determine column types (oids) */
Tcl_AppendObjToObj(sqlQuery, objv[2]);
+ Tcl_AppendToObj(sqlQuery, "\" LIMIT 1", -1);
if (ExecSimpleQuery(interp, cdata->pgPtr, Tcl_GetString(sqlQuery),
&resType) != TCL_OK) {
Tcl_DecrRefCount(sqlQuery);
return TCL_ERROR;
@@ -3519,5 +3520,6 @@
* Local Variables:
* mode: c
* c-basic-offset: 4
* End:
*/
+