I am unable to alter table engine while importing SQL dump file in clustered environment it generates error - mysql-workbench

I am importing the SQL dump file in MySQL NDB Clustering Environment All the tables are imported successfully on node1. but they are not clustered on node 2. For this execute the following command:
Alter Table su_contribution ENGINE=NDBCLUSTER;
This command is executed successfully with some tables but not with all tables with some tables it generates the error:
I want to import the dump sql dump file but facing these issues:

Related

Copying (exporting) and importing a partitioned table in PostgreSQL

I would like to export a partitioned table in PostgreSQL and then import it into the same table (already created with all the relations, etc.) in another PostgreSQL database. Is it possible, how could it be done?
I am using the export function of the pgAdmin tool and I get the following error:
"ERROR: cannot copy from partitioned table HINT: Try the COPY (SELECT
...) TO variant".

How to DROP tables from specific database-schema in Postgresql?

I am new to Postgresql and so far I have not found a way to drop a table from specific database. To give some context:
We are doing a synchronization from Oracle to PostgreSQL of 5 tables. In postgres I have a database SoloCopy and the schema is the default public. In the Postgresql instance we have also 2 more databases SoloSynch and postgres (the default one).
What I want to do is to select SoloCopy database and:
DROP TABLE public.table1;
When I do the above DROP statement table1 is deleted only from the database that was selected when opening SQL Query. But I want to specify the database before that and to be irrelevant from where the SQL Query was open. How can I do that?
I found an answer on my own. Setup can be found here:
Psql in Task Scheduler does not run a file script
Basically I needed to use PSQL and with the connection string there I connect to a specific DB, which I can drop the tables from. The details for PGPASSWORD and the .bat file I ended up creating are in the link above. Had to start everything from CMD and switch to psql from there.

Issue with Postgres roles after exporting then restoring from Heroku

I'm new to Postgres and Heroku. I've inherited a project with a Postgres DB hosted on Heroku and I'd like to export it from there for local use inside Docker. I've got as far as exporting and then restoring (via pg_restore) the DB inside my container, but when it builds my DB I get loads of warnings like:
pg_restore: from TOC entry 285; 1259 16897 TABLE foo u2ae1fgct609sl
pg_restore: error: could not execute query: ERROR: role "u2ae1fgct609sl" does not exist
Command was: ALTER TABLE public.foo OWNER TO u2ae1fgct609sl;
Presumablty this is because I've exported/restored the DB but not the corresponding users. Heroku doesn't seem to mention this part in its docs on exporting/restoring/importing Postgres DBs.
What can I do about this? Can I somehow tell it to set as the owner the DB user that Docker created when spinning up the container, or am I on the wrong lines?

Convert dbeaver create table script into sql server script

I have to migrate some table from Database informix (i'm using dbeaver for it) to Sql server.
When i click on table to create DDL script , it's different script than sql server create table script.
Does anyone know the hack that how we can generate sql server create table script from dbeaver tables.
Thanks

How to use psql to copy rows?

I have 2 dbs on two different servers.
How can I copy using psql all the missing rows from db1 table to db2 table ?
If this is not possible.. How can I copy the entire table ?
Can you use a contrib module? If so, how about trying dblink. More information here
This is not possible with psql directly using a single SQL statement because you cannot connect to two different servers at the same time.
The only way you can do it:
connect to db1
export the table contents using psql's \copy command (if you have access to the server, you can also use the SQL statement COPY
connect to db1
import the text file using \copy or COPY depending on where the input file is located