thinkwise-software-factory-postgresql-migration

Migrates Thinkwise Software Factory models to dual-platform PostgreSQL alongside SQL Server.

5|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/rkortThinkwise/sf-mcp-skills-temp --skill thinkwise-software-factory-postgresql-migration-rkortthinkwise
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: thinkwise-software-factory-postgresql-migration
Source: https://github.com/rkortThinkwise/sf-mcp-skills-temp/tree/main/thinkwise-software-factory-postgresql-migration
Command: npx skills add https://github.com/rkortThinkwise/sf-mcp-skills-temp --skill thinkwise-software-factory-postgresql-migration-rkortthinkwise

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding PostgreSQL as a supported platform to an existing Thinkwise Software Factory application requires porting every category of hand-written SQL — control procedures, calculated fields, prefilters, and domain default queries — while navigating PostgreSQL-specific validation errors, dialect differences, and API gaps that are easy to miss and expensive to debug. ## Core Features & Use Cases - Nine-category migration checklist: Inventories every type of hand-written SQL and configuration that needs porting, from custom control procedures to seed data scripts, with per-platform entity locations. - T-SQL to PostgreSQL dialect reference: Provides mechanical substitution tables plus structural rewrites for triggers (batch inserted/deleted to row-level NEW/OLD), cross-item shared state via session settings, identity retrieval with returning ... into, and IMMUTABLE function requirements for generated columns. - Known issues and workarounds: Documents live-verified API gaps such as read-only branch_rdbms_type, never-generated subroutine placeholders, OData truncation of long template fields, and MERGE/FK errors during large-scale generation. - Use Case: A user asks to add PostgreSQL support to an existing SQL Server-only Thinkwise model; the skill walks through enabling the platform, porting ~150 code objects in risk order, resolving domain/column name collisions, and verifying generated code before deployment. ## Quick Start Ask the assistant to add PostgreSQL as a supported platform to your existing Thinkwise Software Factory model and port all custom SQL logic.

Frequently Asked Questions about thinkwise-software-factory-postgresql-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add PostgreSQL support to an existing Thinkwise Software Factory model?

Enable PostgreSQL manually in the Software Factory UI under Project settings, since branch_rdbms_type is read-only through the API. Then port each category of hand-written SQL — control procedures, calculated fields, prefilters, and default queries — into per-platform templates for rdbms_type 4.

How do I convert T-SQL control procedures to PostgreSQL in Thinkwise?

Create a separate control_proc_template per platform and apply dialect substitutions like isnull to coalesce, getdate to current_timestamp, and scope_identity to returning ... into. Port in risk order: views, defaults, handlers, tasks, subroutines, then triggers, reading generated code after each step.

Why does Thinkwise validation report domain and column name collisions on PostgreSQL?

PostgreSQL places tables, views, and functions in one flat schema, so a domain sharing its exact name with a column fails validation. Rename the domain using task_rename_dom — never the column — after agreeing on a naming convention with the user.

Why does a PostgreSQL calculated column fail with error 42P17?

PostgreSQL requires every function in a GENERATED ALWAYS AS (...) STORED expression to be IMMUTABLE, and concat() is only STABLE. Replace concat() with the || operator, wrapping operands in coalesce if NULL-to-empty-string behavior is needed.

Can framework helper procedures like tsf_user be ported automatically to PostgreSQL?

Yes, Thinkwise ships PostgreSQL counterparts such as pg_tsf_user that generate automatically once the platform is enabled. Run task_generate_code_grp and read the generated code to verify before hand-porting anything.

What are the limitations when migrating Thinkwise models to PostgreSQL via the API?

Enabling the platform requires manual UI action, never-generated subroutines cannot get placeholders via API, and long template fields truncate at about 5000 characters with no chunked-read workaround. Large seed scripts may need finishing in the Software Factory UI.