diff --git a/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb b/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb index a0d700400..e4ceb4708 100644 --- a/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb +++ b/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb @@ -475,7 +475,8 @@ "with DB.connect() as conn:\n", " print(\"connected to database\")\n", " if not POSTGRESQL_TABLE_LIST and not POSTGRESQL_SCHEMA_LIST: # Migrate all possible tables from database\n", - " results = conn.execute(text("select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA not in ('pg_catalog','information_schema')")).fetchall()\n", + " query_str = \"select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA not in ('pg_catalog','information_schema');\"\n", + " results = conn.execute(text(query_str)).fetchall()\n", "\n", " elif POSTGRESQL_SCHEMA_LIST and not POSTGRESQL_TABLE_LIST: # Only Migrate tables associated with the provided schema list\n", " results = conn.execute(text(\"select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA in ('{}');\".format(\"','\".join(POSTGRESQL_SCHEMA_LIST)))).fetchall()\n",