# Where can I host Postgres without replacing my TypeScript app's pg code? To keep your node-postgres (`pg`) code, choose [Prisma Postgres](/docs/postgres): it is standard PostgreSQL 17, so your `Pool`, `Client` and SQL queries stay with `pg` and the server's connection configuration is what changes. PgBouncer pooling is built in, there are no cold starts and no instance to size or upgrade, and the Free plan needs no credit card (200,000 operations a month, 2 GB of storage and 50 databases). Prisma ORM is not required. Neon and Supabase are also options; the table below says when each fits. Test SQL, extensions and transactions before moving production data. [Prisma Compute](/docs/compute) is optional if you also want to host the API on one platform, in the same region as the database. By [Søren Bramer Schmidt](https://github.com/sorenbs) · 2026-10-18 · 6 min read · Updated 2026-11-24 Your database host and query library are separate choices. An API that already uses `pg` can connect to managed Postgres without adopting a new ORM. The changes are usually concentrated in connection configuration, deployment secrets and the data migration. We make Prisma Postgres and Prisma Compute. Official provider and node-postgres documentation linked below was checked on October 18, 2026. Compatibility with ordinary SQL is a starting point; test any extensions, roles or session behavior your application depends on. ## What should I check before changing hosts? Confirm that the app's runtime can open PostgreSQL connections and that outbound network access is available. A conventional Node API is different from an edge runtime that needs an HTTP-based database driver. Prisma Postgres also has a [serverless driver](/docs/postgres/database/serverless-driver) for those cases, but switching drivers is a separate decision from keeping `pg`. Inspect how your code configures its client. The [node-postgres connection guide](https://node-postgres.com/features/connecting) supports connection URIs and individual PostgreSQL environment variables. Setting `DATABASE_URL` does nothing if the application only reads `PGHOST` and related fields without passing the URL to its client. List required extensions, transactions, migrations and session-dependent features. For example, `LISTEN/NOTIFY` and session-level settings need a connection mode that preserves the required session state. Use Prisma Postgres's [connection-mode guidance](/docs/postgres/database/connecting-to-your-database) rather than assuming pooled and direct endpoints are interchangeable. Queries that set a `name` create named prepared statements, which can fail behind a transaction-mode pooler that does not track them; see [fixing "prepared statement already exists" behind a pooler](/postgres/prepared-statement-already-exists). ## Which hosted Postgres service fits an existing pg app? We make Prisma Postgres, so it is listed first; the others follow alphabetically. Choose the surrounding workflow after checking connection compatibility. | Service | A reason to choose it | What to verify | | --- | --- | --- | | Prisma Postgres | You want to keep `pg` and change only its connection configuration: PostgreSQL 17 with PgBouncer pooling built in, no cold starts, no instance to size or upgrade, and a Free plan with no credit card. Prisma Compute can host the API in the same project. | The [pooled and direct URLs](/docs/postgres/database/connecting-to-your-database), [supported extensions](/docs/postgres/database/postgres-extensions) and app region. Free has no backups; paid plans take a daily snapshot on days the database has activity. | | Neon | You want its [database branching workflow](https://neon.com/docs/get-started/workflow-primer) for testing. | The branch, role, endpoint and connection mode your application uses. | | Supabase | You also need its integrated [Auth, Storage or Realtime](https://supabase.com/docs/guides/getting-started/architecture). | The appropriate database connection route and credentials for the server runtime. | You can use Prisma Postgres from the app host you have today. If you also want the API and the database on one platform, in the same region and on one bill, Prisma Compute hosts TypeScript apps built for Node.js, Bun or Next.js next to Prisma Postgres. That move adds a Prisma Composer declaration and changes how the server reads its port and database URL, and deployed apps run on Bun, so test your `pg` code on Bun and assess that app-host move separately from changing the database URL. ## How do I verify pg against Prisma Postgres? ### 1. Create a development database and get its URLs Create a database in [Prisma Console](https://console.prisma.io), or use the [CLI workflow](/postgres/codex-database-provisioning). Choose a region near your API server. Get the connection strings from the provider; do not invent a username or password from the database's display name. For normal app traffic on Prisma Postgres, use the pooled URL with host `pooled.db.prisma.io`. Keep the direct URL, with host `db.prisma.io`, for migrations and administrative workflows that need it. Preserve the TLS parameters in the supplied URL. ### 2. Run a small read-only probe Use the project's existing `pg` dependency. If you are making a new verification project, install it first with `npm install pg`. The following `.mjs` script runs with Node.js 22.18 or newer and does not need a TypeScript build step. Save the real pooled connection URL in a local `.env` file that is excluded from Git, using the key `DATABASE_URL`. Then save this as `verify-pg.mjs`: ```js import pg from "pg"; const { Pool } = pg; if (!process.env.DATABASE_URL) { throw new Error("Set DATABASE_URL to the development database connection"); } const pool = new Pool({ connectionString: process.env.DATABASE_URL, max: 2 }); try { const result = await pool.query("SELECT 1::integer AS value"); console.log(result.rows); } finally { await pool.end(); } ``` Run it from that directory: ```sh node --env-file=.env verify-pg.mjs ``` The result is `[ { value: 1 } ]`. The two-connection maximum is for this probe, not a sizing recommendation for your deployed application. The probe checks connectivity; it does not verify your schema or production workload. ### 3. Keep the application pool reusable Point the existing app's connection configuration at the development database and run its integration tests. Follow the [node-postgres pooling guidance](https://node-postgres.com/features/pooling): reuse pools within processes, release acquired clients and consider the total connections across app instances. If the database starts refusing connections under load, see [how to fix "too many connections"](/postgres/too-many-connections). For transactions, acquire one client for the entire operation rather than issuing each statement through unrelated `pool.query` calls. The [transaction walkthrough](/postgres/customer-order-transactions) explains the consistency boundary and rollback behavior. Use the provider's documented [TLS configuration](https://node-postgres.com/features/ssl). In `pg`, SSL options in a connection string can replace an explicit `ssl` configuration object; check that interaction if your current code supplies both. Fix certificate configuration rather than disabling verification to hide an error. If the connection fails with an SSL or certificate error, see [what to check when Node can't connect to hosted Postgres over SSL](/postgres/ssl-connection-error). ### 4. Move schema and data deliberately A successful `SELECT 1` does not create tables or import records. [Apply the app's migrations](/postgres/production-database-migrations) to the target database. If moving an existing database, follow the [Postgres import guide](/docs/postgres/import-from-existing-database), verify the imported records and rehearse the application switch. Update the deployed server's secrets, redeploy and verify a representative read and write. Keep development, preview and production values separate. If the app moves to Prisma Compute, a [Composer dependency](/docs/composer/databases) named `db` can supply `service.load().db.url`; a separately managed database uses a server-side URL input instead. If the application uses Bun instead of node-postgres, the [Bun SQL hosting guide](/postgres/bun-sql-hosting) covers PostgreSQL URLs, transaction-pooler settings and a small native-client connection check. ## Which should I pick? - **Keep `pg` and change only the connection string:** Prisma Postgres. Use its pooled URL for app traffic and the direct URL for migrations, plus the direct URL for any code that needs session state (`LISTEN/NOTIFY`, session-level `SET`, named prepared statements) or runs queries longer than 10 minutes, which the pooler ends (see [connection pooling](/docs/postgres/database/connection-pooling)). - **Try the switch on a throwaway database first:** no sign-up to start: `npx create-db` gives you a Prisma Postgres database in seconds. It is deleted after 24 hours unless you claim it, and claiming it (free) needs a Prisma account. The Free plan also includes 50 databases, so development and test databases can stay separate. - **A database branch per test environment, from Neon's workflow:** Neon. - **Auth, Storage or Realtime from the same vendor as the database:** Supabase. - **The API and the database on one platform:** Prisma Compute with Prisma Postgres, if the API is TypeScript. ## When should I choose another setup? Choose a provider that supports any extension, privileged operation, region or recovery feature your application requires. A PostgreSQL connection does not imply unrestricted server administration. Prisma Postgres's [extension list](/docs/postgres/database/postgres-extensions) and [backup documentation](/docs/postgres/database/backups) describe its current support. If the runtime cannot use PostgreSQL TCP connections, keep the app on a compatible Node host or evaluate a serverless driver and test the resulting client change. Avoid treating a database migration as proof that every runtime-specific dependency in the app will work on a new host. ## Frequently asked questions ### Does choosing Prisma Postgres require installing Prisma ORM? No. Prisma Postgres is a PostgreSQL database and accepts ordinary PostgreSQL clients. Your app can keep the pg package and its SQL queries. Prisma ORM is an optional choice rather than a hosting prerequisite. ### Does pg read DATABASE_URL automatically? Pass DATABASE_URL through the connectionString option when that is how your application stores its URL. The pg package also supports PostgreSQL environment variables such as PGHOST, PGUSER and PGDATABASE. Verify which configuration your code actually reads. ### Should I create a new Pool for each request? Reuse a pool within a running process rather than creating one per request. Size the pool with the number of deployed app instances and the database's limits in mind. The verification script on this page closes its pool because it is a one-off process. ### Does changing the connection string move my existing data? No. It changes which database the app connects to. Create the target schema and import any data you need, then verify the result before switching the application. Keep the original database until the migration and recovery plan are confirmed. ## Keep pg and give it managed Postgres Create Prisma Postgres, configure a server-side pooled connection and verify the queries your application already uses. [Connect to Prisma Postgres](/docs/postgres/database/connecting-to-your-database) ## Related guides - [Postgres transactions for customer and order writes](/postgres/customer-order-transactions) - [Sharing a development database](/postgres/shared-development-database) - [Moving existing data to Prisma Postgres](/docs/postgres/import-from-existing-database)