convert this to postgres 


        static void Main(string[] args)
        {
            // Connection strings for the source and destination databases
            string sourceConnectionString = "Host=rsa-db-13-02-cluster.cluster-ch8u20mcgbmn.us-east-1.rds.amazonaws.com;Port=5432;Database=rsa;Username=rapid_scan_app_p;Password=dc8WlXy2700849Ppv0cj;Database=rsa";
            string destinationConnectionString = "Host=rsa-prod.cluster-ch8u20mcgbmn.us-east-1.rds.amazonaws.com;Port=5432;Database=rsa;Username=rapid_scan_app_p;Password=DCSLg5gMEq1HCmyiDPNf;Database=rsa";
            // List of IDs to be fetched
            List<string> ids = new List<string>
            {
                "664d6d9b-dad4-4593-98e9-453be906a853",
                "ec1f3f3d-d1a5-464d-b9cd-b0b29f7afa75",
                "e49943cd-0022-493d-b824-6fce9189e1c9",
                "8f3e4552-a1ee-4a16-aac3-c8a3f8b43f47",
                "74382797-4b42-4111-9494-f8cb6d486fc5",
                "2499f676-6a3a-4b7d-a893-dd5961b36ac8",
                "327941d3-db64-40ea-a188-149934558876",
                "56b843f9-06b5-420d-b943-184f5cffab6b",
                "37e10623-59c9-40a5-b585-a7514c5f1f8a",
                "c3d67137-7b84-4a84-9f9f-db41d72e38a9",
                "2fff4fa0-3653-4144-94d1-e8b36db17c22",
                "e7ced945-c77d-4557-b66d-61826458560d",
                "a81aadb5-bf3c-40a7-95ac-ceb9c108e865",
                "7101bea1-e53c-4f73-bf8b-b96b3b866053",
                "6806143d-24ad-4758-b3bb-b1cf8656436a",
                "d620d990-8e8c-408e-987a-801081539406",
                "6b2dac56-595a-4864-ad03-987814ae2704",
                "1c5f3a31-51b8-4704-853a-b89bab8fbdc7",
                "8d20f8b8-af9b-4010-8f9b-ebca0243b2ca"
            };

            string idList = string.Join(",", ids.ConvertAll(id => $"'{id}'"));

            // Query to fetch the data
            string selectQuery = $@"
                SELECT ""Id"", ""EbayItemId"", ""StoreId"", ""Title"", ""CategoryId"", ""ConditionId"", 
                       ""CategoryMappingAllowed"", ""SKU"", ""Description"", ""Price"", ""Quantity"", 
                       ""DispatchTimeMax"", ""ListingDuration"", ""ListingType"", ""ShippingMethod"", 
                       ""Weight"", ""Height"", ""Width"", ""Length"", ""Attributes"", ""Status"", 
                       ""PublishedOn"", ""PublishedBy"", ""IsDeleted"", ""CreatedOn"", ""CreatedBy"", 
                       ""ModifiedOn"", ""ModifiedBy"", ""EbayProductDetails"", '' as ""Addebayfeature"",  
                       ""SyncedOn"", ""BestOfferEnabled"", ""IsListingCreatedFromScratch"", 
                       ""MinimumBestOfferPrice"", ""BestOfferAutoAcceptPrice"", ""StartTime"", 
                       ""EndTime"", ""ExpirationDate"", ""Location"", NULL as ""ReturnPolicyId"", 
                       NULL as ""ShippingPolicyId"", '' as ""ConditionDescription""
                FROM public.""EbayListing""
                WHERE ""Id"" IN ({idList});";

            try
            {
                using (var sourceConnection = new NpgsqlConnection(sourceConnectionString))
                {
                    sourceConnection.Open();
                    using (var selectCommand = new NpgsqlCommand(selectQuery, sourceConnection))
                    using (var reader = selectCommand.ExecuteReader())
                    {
                        using (var destinationConnection = new NpgsqlConnection(destinationConnectionString))
                        {
                            destinationConnection.Open();
                            while (reader.Read())
                            {
                                // Prepare the insert query with actual values
                                string insertQuery = @"
                                    INSERT INTO public.""EbayListing"" 
                                    (""Id"", ""EbayItemId"", ""StoreId"", ""Title"", ""CategoryId"", 
                                    ""ConditionId"", ""CategoryMappingAllowed"", ""SKU"", ""Description"", 
                                    ""Price"", ""Quantity"", ""DispatchTimeMax"", ""ListingDuration"", 
                                    ""ListingType"", ""ShippingMethod"", ""Weight"", ""Height"", 
                                    ""Width"", ""Length"", ""Attributes"", ""Status"", ""PublishedOn"", 
                                    ""PublishedBy"", ""IsDeleted"", ""CreatedOn"", ""CreatedBy"", 
                                    ""ModifiedOn"", ""ModifiedBy"", ""EbayProductDetails"", 
                                    ""Addebayfeature"", ""SyncedOn"", ""BestOfferEnabled"", 
                                    ""IsListingCreatedFromScratch"", ""MinimumBestOfferPrice"", 
                                    ""BestOfferAutoAcceptPrice"", ""StartTime"", ""EndTime"", 
                                    ""ExpirationDate"", ""Location"", ""ReturnPolicyId"", 
                                    ""ShippingPolicyId"", ""ConditionDescription"") 
                                    VALUES (
                                    @Id, 
                                    @EbayItemId, 
                                    @StoreId, 
                                    @Title, 
                                    @CategoryId, 
                                    @ConditionId, 
                                    @CategoryMappingAllowed, 
                                    @SKU, 
                                    @Description, 
                                    @Price, 
                                    @Quantity, 
                                    @DispatchTimeMax, 
                                    @ListingDuration, 
                                    @ListingType, 
                                    @ShippingMethod, 
                                    @Weight, 
                                    @Height, 
                                    @Width, 
                                    @Length, 
                                    @Attributes, 
                                    @Status, 
                                    @PublishedOn, 
                                    @PublishedBy, 
                                    @IsDeleted, 
                                    @CreatedOn, 
                                    @CreatedBy, 
                                    @ModifiedOn, 
                                    @ModifiedBy, 
                                    @EbayProductDetails, 
                                    NULL,  
                                    @SyncedOn, 
                                    @BestOfferEnabled, 
                                    @IsListingCreatedFromScratch, 
                                    @MinimumBestOfferPrice, 
                                    @BestOfferAutoAcceptPrice, 
                                    @StartTime, 
                                    @EndTime, 
                                    @ExpirationDate, 
                                    @Location, 
                                    NULL,  
                                    NULL,  
                                    @ConditionDescription); ";

                                using (var insertCommand = new NpgsqlCommand(insertQuery, destinationConnection))
                                {
                                    // Add parameters for inserting values safely
                                    insertCommand.Parameters.AddWithValue("@Id", reader["Id"]);
                                    insertCommand.Parameters.AddWithValue("@EbayItemId", reader["EbayItemId"]);
                                    insertCommand.Parameters.AddWithValue("@StoreId", reader["StoreId"]);
                                    insertCommand.Parameters.AddWithValue("@Title", reader["Title"]);
                                    insertCommand.Parameters.AddWithValue("@CategoryId", reader["CategoryId"]);

                                    // Handle nullable integer and boolean parameters
                                    insertCommand.Parameters.AddWithValue("@ConditionId", reader["ConditionId"] != DBNull.Value ? (int?)reader["ConditionId"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@CategoryMappingAllowed", reader["CategoryMappingAllowed"] != DBNull.Value ? (bool)reader["CategoryMappingAllowed"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@SKU", reader["SKU"]);
                                    insertCommand.Parameters.AddWithValue("@Description", reader["Description"]);
                                    insertCommand.Parameters.AddWithValue("@Price", (double)reader["Price"]);
                                    insertCommand.Parameters.AddWithValue("@Quantity", (int)reader["Quantity"]);

                                    // Handle DispatchTimeMax as nullable
                                    if (reader["DispatchTimeMax"] != DBNull.Value)
                                    {
                                        insertCommand.Parameters.AddWithValue("@DispatchTimeMax", (int)reader["DispatchTimeMax"]);
                                    }
                                    else
                                    {
                                        insertCommand.Parameters.AddWithValue("@DispatchTimeMax", DBNull.Value);
                                    }

                                    insertCommand.Parameters.AddWithValue("@ListingDuration", reader["ListingDuration"]);
                                    insertCommand.Parameters.AddWithValue("@ListingType", reader["ListingType"]);
                                    insertCommand.Parameters.AddWithValue("@ShippingMethod", reader["ShippingMethod"]);

                                    // Weights and Dimensions as nullable
                                    insertCommand.Parameters.AddWithValue("@Weight", reader["Weight"] != DBNull.Value ? (double?)reader["Weight"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@Height", reader["Height"] != DBNull.Value ? (double?)reader["Height"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@Width", reader["Width"] != DBNull.Value ? (double?)reader["Width"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@Length", reader["Length"] != DBNull.Value ? (double?)reader["Length"] : (object)DBNull.Value);

                                    insertCommand.Parameters.AddWithValue("@Attributes", reader["Attributes"]);
                                    insertCommand.Parameters.AddWithValue("@Status", reader["Status"]);
                                    insertCommand.Parameters.AddWithValue("@PublishedOn", reader["PublishedOn"]);
                                    insertCommand.Parameters.AddWithValue("@PublishedBy", reader["PublishedBy"] != DBNull.Value ? (Guid?)reader["PublishedBy"] : null);
                                    insertCommand.Parameters.AddWithValue("@IsDeleted", (bool)reader["IsDeleted"]);
                                    insertCommand.Parameters.AddWithValue("@CreatedOn", (DateTime)reader["CreatedOn"]);
                                    insertCommand.Parameters.AddWithValue("@CreatedBy", (Guid)reader["CreatedBy"]);
                                    insertCommand.Parameters.AddWithValue("@ModifiedOn", (DateTime)reader["ModifiedOn"]);
                                    insertCommand.Parameters.AddWithValue("@ModifiedBy", (Guid)reader["ModifiedBy"]);
                                    insertCommand.Parameters.AddWithValue("@EbayProductDetails", reader["EbayProductDetails"]);
                                    insertCommand.Parameters.AddWithValue("@SyncedOn", reader["SyncedOn"] != DBNull.Value ? (DateTime?)reader["SyncedOn"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@BestOfferEnabled", (bool)reader["BestOfferEnabled"]);
                                    insertCommand.Parameters.AddWithValue("@IsListingCreatedFromScratch", (bool)reader["IsListingCreatedFromScratch"]);
                                    insertCommand.Parameters.AddWithValue("@MinimumBestOfferPrice", reader["MinimumBestOfferPrice"] != DBNull.Value ? (double?)reader["MinimumBestOfferPrice"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@BestOfferAutoAcceptPrice", reader["BestOfferAutoAcceptPrice"] != DBNull.Value ? (double?)reader["BestOfferAutoAcceptPrice"] : (object)DBNull.Value);
                                    insertCommand.Parameters.AddWithValue("@StartTime", reader["StartTime"]);
                                    insertCommand.Parameters.AddWithValue("@EndTime", reader["EndTime"]);
                                    insertCommand.Parameters.AddWithValue("@ExpirationDate", reader["ExpirationDate"]);
                                    insertCommand.Parameters.AddWithValue("@Location", reader["Location"]);
                                    insertCommand.Parameters.AddWithValue("@ConditionDescription", reader["ConditionDescription"]);

                                    insertCommand.ExecuteNonQuery();
                                }
                            }
                        }
                    }
                }

                Console.WriteLine("Data transfer completed successfully.");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
        }