Redshift SQL Workbench doesnot show Object Explorer - amazon-redshift

I am relatively new to Redshift but have used the SQL Server Management Studio(SSMS) to work with SQL Server.
Now I have a project with Redshift and am using the SQL Workbench to query the Redshift Cluster.
However I dont find an Object Explorer kind of window on the SQL Workbench interface. Is there such a window on the SQL workbench?
Also, how do i select the active Redshift database on the SQL Workbench?
Used to be pretty simple in SSMS(Select the active database from a drowp down option list), but i am lost when it comes to SQL Workbench?
Thanks!

The comment above from #a_horse_with_no_name is correct. The tab you're trying to find is called "Database Explorer" and it can be opened Tools -> Show Database Explorer.
Credit goes to #a_horse_with_no_name for answering first.

Related

Can not add/delete/edit record in Oracle SQL Deverloper connect to Postgresql

I love Oracle SQL Developer and not a big fan of PgAdmin. I am trying to connect to the Postgresql from Oracle SQL Developer. And i am success.
However, i am not able to add/delete/edit any record.
I am using third party JDBC Driver: postgresql-42.2.23.jar
any suggestion ? Thank you
Write the SQL (INSERT|UPDATE|DELETE) to do that in the SQL worksheet.
If you want to browse a table and 'live edit' records in the GUI, you'll need to be connected to an Oracle Database.

DB2 Database Export in Oracle SQL Developer gives an empty connection list

I need to backup my DB so I use Tools --> Database Export.
However, when I want to choose my connection I got no connection in drop down list.
Just to mention that I can see my connection list in "Connections" tab and also all connections in "C:\Users{MyUser}\AppData\Roaming\SQL Developer\system3.0.04.34\o.jdeveloper.db.connection.11.1.1.4.37.59.31\connections.xml" file
Same behavior happens also in "Database Copy", "database Diff" and in "Monitor SQL"
Any idea ?
Thanks in advance
The Database Export feature is built for Oracle Databases only. That's why you aren't seeing your DB2 connections in the Export, Copy, or DIFF wizards in ORACLE SQL Developer (keyword, Oracle).
If you want to backup your IBM DB2 database, you need to use the tools that IBM gives you for managing DB2.

Connecting to Amazon Redshift in Azure Data Studio via the Postgresql Connector

I've recently joined a company with a mixed set of databases that include a Redshift cluster and some SQL databases. I'd like to use a single IDE to access both for analytical reporting, so I don't have to switch between tools. I'm currently using workbench, which works, but it's not clicking with me.
I do like Azure Data Studio, but it's SQL Server and Postgres only. Given the similarities between Redshift and Postgres, I thought I'd see if I could connect using the Postgres driver.
I've installed the Postgres extension and can "connect" to the database. However when I try to explore the database using the tree view, I get the error message 'Cannot Expand Node'. When I run a simple query that works in workbench, e.g.
Select * from [server].[database].[table]
I get the following Error message:
Started executing query at Line 1
cursors can only be used within the transaction that created them.
Total execution time: 00:00:00.019
I know I'm trying to do something that shouldn't be done. And if I can't, I can't. But has anyone here managed to get a redshift connection going in Azure Data Studio?
FWIW, I've come across a GitHub Repository that may be a Redshift driver for data studio - but this looks like a clone of the Postgres driver, with no activity since march (not even renaming the 'Postgres' titles to Redshift)... and therefore I'm dubious.

Why does running a query return 'table_oid' under messages and nothing under Data Output

Running any sort of query on pgAdmin 4 just returns a 'table_oid' under messages.
I am able to get the necessary data when running the query from the command line, for example
SELECT ST_MakePolygon(ST_GeomFromText('LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'));
I understand that table_oid refers to the object id of the table, but I have no idea how to access it.
Pardon me please if it is a simple question, but I am unable to find any resources online
Expected:
010300000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40
Actual:
table_oid
From pgAdmin 4 project tracker:
Temporary solution until next release and tested in my ubuntu 18.04 machine:
Replace these two 2 files:
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/__init_*_py
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/command.py
Link to files:
__init_*_.py
command.py
Note:
The first file's name is __init_*_py, without the *.
Try Squirrel SQL - Universal SQL Client. It's an extremely useful SQL client. I use it to access SQL Server, PostgreSQL, MySQL, Access. It's not as good looking as pgAdmin4.
Install JAVA first, if not already installed.
Install Squirrel SQL.
Download the latest PostgreSQL JDBC driver, e.g. postgresql-42.2.6.jar, and put it into a convenient location.
Open/Start Squirrel.
Click the Drivers Tab and scroll down to PostgreSQL. Double click PostgreSQL. A "Change Driver: PostgreSQL" dialog box/window will open.
Click the Extra Class Path tab and click the Add button. Navigate to and choose the PostgreSQL JDBC Driver that was downloaded in step 3. above.
Click the List Drivers button, "org.postgresql.Driver" should appear in the Class Name drop down box.
Click OK.
Setup PostgreSQL JDBC Driver
The driver should now be setup.
Click the Aliases tab to setup a connection to your database. See my example screenshots.
Setup Database Connection

How to export data from SQL Server to PostgreSQL?

I need to export all tables from SQL Server to PostgreSQL.
Try: I tried from SQL Server IDE but at some stage its giving the error about data types are different.
Question:How can I do export of data from SQL Server to PostgreSQL? Is COPY does my job? If yes, then how can I export all tables including records?
You can't export data from MSsql then import to PostgreSql because it is not same syntax, data type, but you can use tool to migration data from mssql to postgreSql,
See more in topic
migrate data from MS SQL to PostgreSQL?
Use https://dbeaver.io/
Create MS SQL and PostgreSQL database connections (login)
Create target tables in PostgreSQL (same structures in MS SQL)
F5 to see new tables
Right-click on new tables -> 'Import Data' -> You will see 'Data Transfer' window
Choose 'Table' type then click 'Next' -> You will see 'Select input object', where you can choose tables from MS SQL connection
Just 'next' and check settings that you need, done :D
First export the schema into a file and run it against PostgreSQL until you've removed all incompatibilities.
You could try to do the same with the data you want to export but you may be better off writing a Python script to migrate it.
There is an absolutely simple way using built-in SSIS tool using Management Studio. You can find the detailed answer here.
Use https://dbeaver.io/ , as An Le mentioned.
After 40 years of DB development, migrating DB data is still a challenge. DBeaver is a free tool to use for data migration. But you still have to migrate the schema.
Exporting data from DBeaver
From contextual menu of your SQLServer database or schema select Tools > Create new Task > Common > Data Export
You will generate SQL insert files or CSV files. For migration between database types use CSV files.
Cons of SQL Server Migration Tool
Unable to migrate rows containing booleans.
Export ended up in errors of migrationg data with Bool columns, complaining that value is not boolean, although both source and destination columns where of boolean type.
Unable to continue with the next tables afer one table migration fails.
SQL Server - A single error stops all migration even for tables that are not related to the initial error.
Configuring the tool over and over again, trying to export your data is a waste of time. SQL Server migration task does not save the configuration of the source and destination connections. And the wizard is not user friendly, spending your time on it is frustrating. I assume the migration project was abandoned for at least 10 years.