I need to fetch data from my laptop (Postgresql) and insert that to the main server (in a different machine) using also a PostgreSQL. In MSSQL I normally do this:
- BEGIN TRY
- BEGIN TRANSACTION
- INSERT Main_Server.databasename.tbltransactions
- SELECT * FROM Local_Server.databasename.tbltransactions
- WHERE synchronized IS NULL
- UPDATE Local_Server.databasename.tbltransactions SET synchronized = GETDATE() WHERE synchronized IS NULL
- COMMIT TRANSACTION
- END TRY
- BEGIN CATCH
- ROLLBACK TRANSACTION
- RAISERROR('There was a problem connecting to the server database. The connection was lost.',16,1)
- END CATCH

Jignesh KumarPosted Jul 14, 2020, 10:29 PM
Jefferson S. MottaPosted Jul 14, 2020, 11:30 AM
Jes SiePosted Jul 14, 2020, 9:18 AM
Jefferson S. MottaPosted Jul 14, 2020, 9:07 AM