PasteZap
🌐 简体中文
免费 · 无需注册

免费 · 开发

在线 PostgreSQL.

在浏览器中运行真正的 PostgreSQL:建表、插入数据,测试查询、窗口函数、JSONB 和 CTE,并保存数据库以便日后打开。

开始之前

部分技术控件使用英语。支持 Unicode 文本;文件格式和输出语言取决于具体工具。

下面以英语列出技术限制。处理大型文件或使用结果之前,请先查看这些限制。

RUNS IN YOUR BROWSER · NO ACCOUNTStarting PostgreSQL (about 16 MB the first time)…

Real PostgreSQL compiled to WebAssembly (PGlite, Apache-2.0), single user, in memory: reloading the page starts over unless you save the database. Extensions other than the built-in ones and network access are not available.

在浏览器中运行 PostgreSQL

  1. 等待页头显示 PostgreSQL 版本;首次访问会下载一次引擎(约 16 MB)。
  2. 在 Example 中选择程序,或输入自己的 SQL。用分号分隔的多条语句会依次执行。
  3. 点击 Run (Ctrl+Enter)。结果以表格显示,可下载为 CSV;左栏列出您的表及其列。
  4. 点击 Save database 下载整个数据库,以后用 Open saved database 继续。

示例:employees 示例会建表、插入四名员工并按部门分组。Engineering 平均为 70000.00,Sales 为 56000.00。

功能与限制

这是编译为 WebAssembly 的真正 PostgreSQL,SQL 行为与服务器上一致:约束、序列、连接、窗口函数、递归 CTE、JSONB、generate_series 和日期函数都可使用。适合学习、面试准备和测试查询。

数据库只存在于本页面:若未保存,刷新后会重新开始;没有网络访问、其他用户或额外扩展。处理 SQLite 文件请使用 SQLite 查看器;查询表格文件请使用对 CSV 和 JSON 文件执行 SQL 查询。

限制与支持格式

输入内容在您的设备上处理。

英语技术说明

Single user, in memory: reloading the page starts over unless you save the database. Results show up to 10,000 rows. No network access and no extra extensions. The first start downloads about 16 MB.

Uses PGlite (Apache-2.0), PostgreSQL compiled to WebAssembly, in a background worker; wasm and data files are served by this site. Supports standard PostgreSQL SQL: joins, window functions, CTEs, JSONB, generate_series, sequences and constraints.

The employees example creates a table, inserts four rows and groups them by department: Engineering averages 70000.00 and Sales 56000.00.

常见问题

我的数据会发送到服务器吗?

不会。PostgreSQL 以 WebAssembly 形式在浏览器的后台 worker 中运行,保存的数据库是您设备上的文件。

用的是哪个 PostgreSQL 版本?

页头显示 SELECT version() 返回的确切版本。

可以从其他程序连接吗?

不可以。它只在本页面中运行,不会开放网络端口。