Description
1. Introduction
This training program is designed for intermediate to advanced Microsoft .NET developers who currently use Microsoft SQL Server as their primary development database and want to develop expertise in PostgreSQL.
The program focuses on transitioning from SQL Server to PostgreSQL, understanding PostgreSQL architecture, mastering SQL and PL/pgSQL programming, integrating PostgreSQL with .NET applications, and developing high-performance, secure, and scalable database solutions.
Special emphasis is placed on comparing Microsoft SQL Server and PostgreSQL, helping participants leverage their existing T-SQL, stored procedure, database design, Entity Framework, and ADO.NET experience.
The training includes practical exercises using PostgreSQL, pgAdmin, DBeaver, Visual Studio, C#, ASP.NET Core, Entity Framework Core, and Npgsql.
Training Objectives
- Understand PostgreSQL architecture and its differences from Microsoft SQL Server.
- Develop proficiency in PostgreSQL SQL, PL/pgSQL, functions, procedures, and triggers.
- Migrate SQL Server database schemas, queries, and application code to PostgreSQL.
- Integrate PostgreSQL with .NET applications using Npgsql, ADO.NET, Dapper, and Entity Framework Core.
- Implement advanced PostgreSQL features, including JSONB, indexing, partitioning, and concurrency management.
- Optimize SQL queries and troubleshoot database performance.
- Implement security, transactions, backup, recovery, and database maintenance.
- Build and deploy production-oriented PostgreSQL-backed .NET applications.
2. Prerequisites
- Intermediate to advanced knowledge of C# and Microsoft .NET development.
- Experience developing applications using ASP.NET Core, Web API, or equivalent .NET frameworks.
- Strong understanding of Microsoft SQL Server database development.
- Working knowledge of T-SQL, joins, subqueries, views, stored procedures, functions, and triggers.
- Experience using SQL Server Management Studio (SSMS).
- Familiarity with Entity Framework Core, ADO.NET, or Dapper.
- Understanding of relational database design, normalization, primary keys, foreign keys, and constraints.
- Basic understanding of indexing, transactions, and SQL query optimization.
- Familiarity with Git, Visual Studio, or Visual Studio Code.
- Basic knowledge of REST APIs and application database connectivity.
3. Recommended Training Duration
Recommended: 40 Hours
4. Training Lab Setup Specifications
- Operating System: Windows 11 Professional, Windows Server, or Ubuntu Linux.
- Processor: Intel Core i5/i7 or equivalent, minimum 4 cores.
- RAM: Minimum 16 GB; 32 GB recommended for Docker and multiple database instances.
- Storage: Minimum 50 GB free SSD space.
- Database: PostgreSQL 17 or 18, with a consistent version across participants.
- Database Administration Tools: pgAdmin 4, DBeaver, and PostgreSQL
psqlCLI. - Development Environment: Visual Studio 2022 or later, or Visual Studio Code with C# extensions.
- .NET SDK: .NET 10 LTS or a project-compatible supported version.
- Database Connectivity: Npgsql, EF Core PostgreSQL provider, and Dapper.
- Migration Environment: SQL Server Developer Edition, SSMS, and sample SQL Server databases.
- API Testing: Postman or Swagger/OpenAPI tooling.
- Version Control: Git and a Git repository.
- Containerization: Docker Desktop or Docker Engine with PostgreSQL containers.
- Performance Tools: PostgreSQL
EXPLAIN,EXPLAIN ANALYZE,pg_stat_statements, andpgbench. - Sample Database: AdventureWorks or equivalent SQL Server database, plus a PostgreSQL training database.
- Connectivity: Internet access for package downloads and software updates.
- Access Permissions: Local administrative rights or preconfigured development environments.
- Trainer Environment: PostgreSQL and SQL Server instances, sample migration scripts, datasets, and working .NET applications.
TABLE OF CONTENTS
Module 1. Introduction to PostgreSQL and SQL Server Comparison
Topic 1.1. PostgreSQL Fundamentals
1.1.1. Introduction to PostgreSQL and its ecosystem
1.1.2. PostgreSQL features, capabilities, and common use cases
1.1.3. PostgreSQL versus Microsoft SQL Server
1.1.4. PostgreSQL versions, extensions, and compatibility considerations
Topic 1.2. PostgreSQL Architecture
1.2.1. PostgreSQL server architecture and process model
1.2.2. Databases, schemas, tablespaces, and storage
1.2.3. PostgreSQL system catalogs and metadata
1.2.4. Write-Ahead Logging (WAL) and MVCC fundamentals
Topic 1.3. Mapping SQL Server Concepts to PostgreSQL
1.3.1. SQL Server instances, databases, and schemas versus PostgreSQL
1.3.2. SSMS versus pgAdmin, DBeaver, and psql
1.3.3. T-SQL versus PostgreSQL SQL and PL/pgSQL
1.3.4. SQL Server data types versus PostgreSQL data types
1.3.5. SQL Server identity, sequences, and PostgreSQL identity columns
Topic 1.4. PostgreSQL Installation and Configuration
1.4.1. Installing PostgreSQL on Windows and Linux
1.4.2. Configuring PostgreSQL services and connections
1.4.3. Creating databases, users, and schemas
1.4.4. Exploring PostgreSQL using pgAdmin and psql
Practical Lab: Install PostgreSQL, configure pgAdmin, create a sample database, and compare SQL Server and PostgreSQL metadata.
Module 2. PostgreSQL SQL Programming for SQL Server Developers
Topic 2.1. PostgreSQL SQL Syntax
2.1.1. SELECT, INSERT, UPDATE, DELETE, and RETURNING
2.1.2. WHERE, ORDER BY, GROUP BY, HAVING, and LIMIT/OFFSET
2.1.3. SQL Server TOP versus PostgreSQL LIMIT and FETCH
2.1.4. SQL Server OUTPUT versus PostgreSQL RETURNING
Topic 2.2. PostgreSQL Data Types
2.2.1. Numeric, character, Boolean, and date/time types
2.2.2. UUID, arrays, JSON, and JSONB
2.2.3. SQL Server NVARCHAR, DATETIME, UNIQUEIDENTIFIER mappings
2.2.4. Type casting using CAST and :: syntax
2.2.5. NULL handling and COALESCE
Topic 2.3. Joins, Subqueries, and Set Operations
2.3.1. INNER, LEFT, RIGHT, FULL, and CROSS joins
2.3.2. Correlated and non-correlated subqueries
2.3.3. UNION, UNION ALL, INTERSECT, and EXCEPT
2.3.4. LATERAL joins versus SQL Server APPLY
Topic 2.4. Common Table Expressions and Window Functions
2.4.1. Common Table Expressions using WITH
2.4.2. Recursive CTEs
2.4.3. ROW_NUMBER, RANK, DENSE_RANK, and NTILE
2.4.4. LEAD, LAG, and window aggregates
2.4.5. PostgreSQL DISTINCT ON and FILTER clauses
Practical Lab: Convert 15–20 T-SQL queries into PostgreSQL SQL, including pagination, CTEs, window functions, and joins.
Module 3. PostgreSQL Database Design and Schema Development
Topic 3.1. Database and Schema Objects
3.1.1. CREATE, ALTER, and DROP operations
3.1.2. Tables, schemas, sequences, and identity columns
3.1.3. Primary keys, foreign keys, and unique constraints
3.1.4. CHECK, DEFAULT, and NOT NULL constraints
Topic 3.2. Advanced Database Design
3.2.1. Normalization and relational data modeling
3.2.2. Generated columns and computed data
3.2.3. Domains, ENUM types, and custom types
3.2.4. Temporary and unlogged tables
Topic 3.3. Views and Materialized Views
3.3.1. Creating and managing views
3.3.2. Updatable views and limitations
3.3.3. Materialized views and refresh strategies
3.3.4. SQL Server indexed views versus PostgreSQL materialized views
Topic 3.4. Schema Evolution
3.4.1. Database schema versioning
3.4.2. EF Core migrations for PostgreSQL
3.4.3. Backward-compatible schema changes
3.4.4. Managing schema changes in CI/CD pipelines
Practical Lab: Design a PostgreSQL schema for an existing SQL Server-based .NET application and implement constraints, views, and schema migrations.
Module 4. PL/pgSQL Programming, Functions, Procedures, and Triggers
Topic 4.1. Introduction to PL/pgSQL
4.1.1. PL/pgSQL language fundamentals
4.1.2. Variables, declarations, and data types
4.1.3. Conditional statements and loops
4.1.4. Exception handling and error reporting
Topic 4.2. PostgreSQL Functions
4.2.1. Creating SQL and PL/pgSQL functions
4.2.2. Input, output, and INOUT parameters
4.2.3. Scalar, table-returning, and set-returning functions
4.2.4. Function volatility, security, and performance
Topic 4.3. Stored Procedures
4.3.1. CREATE PROCEDURE and CALL
4.3.2. Functions versus procedures in PostgreSQL
4.3.3. Transaction control and procedural limitations
4.3.4. Converting SQL Server stored procedures to PostgreSQL
4.3.5. Alternatives to SQL Server table-valued parameters
Topic 4.4. Triggers and Dynamic SQL
4.4.1. BEFORE, AFTER, and INSTEAD OF triggers
4.4.2. Row-level and statement-level triggers
4.4.3. Trigger functions and audit logging
4.4.4. Dynamic SQL using EXECUTE and safe parameter handling
4.4.5. SQL Server inserted/deleted tables versus PostgreSQL trigger mechanisms
Practical Lab: Migrate SQL Server stored procedures, functions, and triggers to PL/pgSQL, including transaction handling and audit logging.
Module 5. PostgreSQL Integration with .NET and C#
Topic 5.1. PostgreSQL Connectivity Using Npgsql
5.1.1. Introduction to Npgsql and the .NET data provider
5.1.2. PostgreSQL connection strings and authentication
5.1.3. NpgsqlDataSource, connections, commands, and readers
5.1.4. Parameterized SQL queries and SQL injection prevention
5.1.5. Connection pooling and timeout configuration
Topic 5.2. ADO.NET and Dapper Integration
5.2.1. PostgreSQL CRUD operations using ADO.NET
5.2.2. Asynchronous database operations
5.2.3. Dapper integration with Npgsql
5.2.4. Mapping PostgreSQL types to C# objects
5.2.5. Bulk operations using PostgreSQL COPY
Topic 5.3. Entity Framework Core with PostgreSQL
5.3.1. Installing the Npgsql EF Core provider
5.3.2. Configuring DbContext and dependency injection
5.3.3. Code-first and database-first development
5.3.4. Entity mapping, relationships, and data annotations
5.3.5. LINQ translation and PostgreSQL-specific behavior
5.3.6. Database migrations and schema management
Topic 5.4. Advanced .NET Database Development
5.4.1. Transactions using EF Core and Npgsql
5.4.2. Optimistic concurrency and row versioning
5.4.3. Query tracking, no-tracking, and compiled queries
5.4.4. Efficient batching and bulk data operations
5.4.5. Error handling, retries, and resilient connectivity
Practical Lab: Develop an ASP.NET Core Web API using PostgreSQL, Npgsql, EF Core, and Dapper. Implement CRUD operations, pagination, transactions, and asynchronous queries.
Module 6. Advanced PostgreSQL Features for Application Developers
Topic 6.1. JSON and JSONB
6.1.1. JSON versus JSONB storage
6.1.2. JSON operators and path expressions
6.1.3. Querying and updating nested JSON documents
6.1.4. JSONB indexing using GIN
6.1.5. Mapping JSONB data to C# and EF Core models
Topic 6.2. Arrays and Advanced Data Types
6.2.1. PostgreSQL arrays and array operators
6.2.2. UUID generation and identity strategies
6.2.3. Range types and temporal data modeling
6.2.4. PostgreSQL date/time and timezone handling in .NET
Topic 6.3. Full-Text Search
6.3.1. PostgreSQL full-text search architecture
6.3.2. tsvector and tsquery
6.3.3. Text ranking and search relevance
6.3.4. Full-text indexing and application integration
Topic 6.4. Advanced PostgreSQL Extensions
6.4.1. PostgreSQL extension architecture
6.4.2. pg_trgm for similarity and fuzzy search
6.4.3. pgcrypto for cryptographic operations
6.4.4. Introduction to PostGIS and pgvector use cases
Practical Lab: Develop a .NET product catalog API with JSONB attributes, full-text search, fuzzy matching, and advanced PostgreSQL data types.
Module 7. Transactions, Concurrency, and Data Integrity
Topic 7.1. PostgreSQL Transaction Management
7.1.1. ACID properties and transaction lifecycle
7.1.2. BEGIN, COMMIT, ROLLBACK, and SAVEPOINT
7.1.3. Transaction isolation levels
7.1.4. SQL Server transaction behavior versus PostgreSQL
Topic 7.2. Multi-Version Concurrency Control
7.2.1. PostgreSQL MVCC architecture
7.2.2. Snapshot visibility and concurrent transactions
7.2.3. SQL Server locking and row versioning versus PostgreSQL MVCC
7.2.4. Transaction ID management and long-running transactions
Topic 7.3. Locking and Deadlock Management
7.3.1. Row-level and table-level locks
7.3.2. SELECT FOR UPDATE and related locking options
7.3.3. Deadlock detection and resolution
7.3.4. Advisory locks and application coordination
Topic 7.4. Concurrency in .NET Applications
7.4.1. Optimistic versus pessimistic concurrency
7.4.2. Handling concurrency conflicts in EF Core
7.4.3. Retry strategies for serialization failures and deadlocks
7.4.4. Designing transaction-safe APIs
Practical Lab: Simulate concurrent .NET transactions, identify deadlocks, and implement transaction isolation and retry handling.
Module 8. PostgreSQL Indexing and Query Performance Optimization
Topic 8.1. PostgreSQL Indexing Fundamentals
8.1.1. B-tree, Hash, GIN, GiST, and BRIN indexes
8.1.2. Composite and covering indexes
8.1.3. Partial and expression indexes
8.1.4. SQL Server clustered/nonclustered indexes versus PostgreSQL indexes
Topic 8.2. Query Execution Plans
8.2.1. PostgreSQL query planner and optimizer
8.2.2. EXPLAIN and EXPLAIN ANALYZE
8.2.3. Sequential scans, index scans, and bitmap scans
8.2.4. Nested loop, hash join, and merge join
8.2.5. Understanding execution costs and row estimates
Topic 8.3. SQL Query Optimization
8.3.1. Identifying expensive queries
8.3.2. Optimizing joins, subqueries, and CTEs
8.3.3. Pagination strategies and keyset pagination
8.3.4. Parameterized queries and prepared statements
8.3.5. Query optimization for EF Core and Dapper
Topic 8.4. PostgreSQL Performance Monitoring
8.4.1. pg_stat_statements and query statistics
8.4.2. pg_stat_activity and session monitoring
8.4.3. VACUUM, ANALYZE, and autovacuum
8.4.4. Detecting table/index bloat and maintenance issues
8.4.5. Application connection pooling and performance bottlenecks
Practical Lab: Optimize slow PostgreSQL queries, compare execution plans with SQL Server, create appropriate indexes, and measure performance improvements.
Module 9. PostgreSQL Migration from Microsoft SQL Server
Topic 9.1. Migration Planning and Assessment
9.1.1. SQL Server to PostgreSQL migration strategies
9.1.2. Schema and application compatibility assessment
9.1.3. Identifying unsupported features and dependencies
9.1.4. Migration risks, effort estimation, and validation planning
Topic 9.2. Database Schema Migration
9.2.1. Mapping SQL Server data types to PostgreSQL
9.2.2. Migrating tables, constraints, indexes, and sequences
9.2.3. Migrating views, functions, and stored procedures
9.2.4. Handling schemas, collations, identity columns, and case sensitivity
Topic 9.3. SQL and Application Code Migration
9.3.1. Converting T-SQL syntax to PostgreSQL SQL
9.3.2. Replacing SQL Server-specific functions and expressions
9.3.3. Migrating MERGE, UPSERT, and pagination logic
9.3.4. Replacing SqlClient with Npgsql
9.3.5. Updating EF Core providers and database mappings
Topic 9.4. Data Migration and Validation
9.4.1. SQL Server data extraction and PostgreSQL loading
9.4.2. Migration tooling and scripted ETL approaches
9.4.3. Data reconciliation and integrity validation
9.4.4. Handling date/time, Unicode, precision, and NULL differences
9.4.5. Cutover planning, rollback, and post-migration testing
Practical Lab: Migrate a sample SQL Server database to PostgreSQL, convert database objects, update an existing .NET application, and validate functional equivalence.
Module 10. PostgreSQL Security, Administration, and Deployment
Topic 10.1. PostgreSQL Security
10.1.1. Roles, users, and privileges
10.1.2. GRANT, REVOKE, and default privileges
10.1.3. Row-Level Security (RLS)
10.1.4. Authentication using pg_hba.conf
10.1.5. TLS connections and secure .NET configuration
Topic 10.2. Backup, Recovery, and Maintenance
10.2.1. Logical backups using pg_dump and pg_restore
10.2.2. Physical backups and WAL fundamentals
10.2.3. Introduction to Point-in-Time Recovery (PITR)
10.2.4. Database maintenance and monitoring
10.2.5. SQL Server backup strategies versus PostgreSQL approaches
Topic 10.3. PostgreSQL Deployment for .NET Applications
10.3.1. PostgreSQL deployment using Docker
10.3.2. Docker Compose for ASP.NET Core and PostgreSQL
10.3.3. Environment-based configuration and secret management
10.3.4. Automated database migrations in deployment pipelines
10.3.5. Logging, health checks, and application observability
Topic 10.4. Production Architecture and Scalability
10.4.1. Connection pooling and PgBouncer concepts
10.4.2. Table partitioning and partition pruning
10.4.3. Streaming replication and read replicas
10.4.4. High availability and failover fundamentals
10.4.5. Managed PostgreSQL services in cloud environments
Practical Lab: Containerize an ASP.NET Core application with PostgreSQL, configure security, implement database backup/restore, and validate deployment health.
Module 11. Capstone Project – Migrating a SQL Server-Based .NET Application to PostgreSQL
Topic 11.1. Project Architecture and Assessment
11.1.1. Review existing ASP.NET Core and SQL Server application
11.1.2. Analyze schema, T-SQL queries, and stored procedures
11.1.3. Identify PostgreSQL compatibility changes
Topic 11.2. Database and Application Migration
11.2.1. Migrate database schema and sample data
11.2.2. Convert SQL Server stored procedures and queries
11.2.3. Configure Npgsql and Entity Framework Core
11.2.4. Implement PostgreSQL-backed REST APIs
Topic 11.3. Optimization and Validation
11.3.1. Implement appropriate indexing strategies
11.3.2. Validate transactions and concurrency behavior
11.3.3. Compare SQL Server and PostgreSQL query performance
11.3.4. Perform functional and integration testing
Topic 11.4. Deployment and Project Review
11.4.1. Deploy the .NET application with PostgreSQL
11.4.2. Configure secure database connectivity
11.4.3. Perform backup and restore validation
11.4.4. Review migration challenges, best practices, and lessons learned
Capstone Deliverable: A functional ASP.NET Core application migrated from Microsoft SQL Server to PostgreSQL, including schema, data, APIs, optimized queries, automated tests, and deployment configuration.
5. Suggested Session-Wise Training Plan
For the recommended 40-hour program, the following schedule prioritizes hands-on developer skills. Advanced administration and migration topics are introduced within the allocated time, with deeper coverage available in the extended program.
| Session | Training Coverage | Duration |
|---|---|---|
| 1 | Modules 1–2: Architecture, SQL Server comparison, PostgreSQL SQL | 4 hours |
| 2 | Modules 2–3: Advanced SQL and database schema development | 4 hours |
| 3 | Module 4: PL/pgSQL, functions, procedures, and triggers | 4 hours |
| 4 | Module 5: Npgsql, ADO.NET, and Dapper | 4 hours |
| 5 | Module 5: EF Core, LINQ, migrations, and asynchronous operations | 4 hours |
| 6 | Modules 6–7: JSONB, advanced data types, transactions, and concurrency | 4 hours |
| 7 | Module 8: Indexing, execution plans, and query optimization | 4 hours |
| 8 | Module 9: SQL Server migration and .NET application conversion | 4 hours |
| 9 | Module 10: Security, backup, deployment, and production fundamentals | 4 hours |
| 10 | Module 11: Capstone implementation, validation, and review | 4 hours |
| Total | 40 hours |
6. Expected Learning Outcomes
Upon successful completion, participants will be able to:
- Independently design and develop PostgreSQL databases.
- Convert existing SQL Server T-SQL scripts into PostgreSQL-compatible SQL and PL/pgSQL.
- Develop and maintain PostgreSQL-backed ASP.NET Core applications.
- Use Npgsql, Dapper, and Entity Framework Core effectively.
- Implement PostgreSQL transactions, indexing, and advanced query features.
- Diagnose and optimize slow SQL queries.
- Plan and execute SQL Server-to-PostgreSQL migrations.
- Apply security, maintenance, backup, and deployment best practices.
Training recommendation: For experienced Microsoft .NET developers, prioritize Modules 4, 5, 8, 9, and 11. These modules deliver the most direct value in moving existing SQL Server-based applications to PostgreSQL. For a production migration project, the extended 56–60-hour program is preferable because it provides more time for migration exercises, performance testing, and the capstone project.







Reviews
There are no reviews yet.