babelfishpg_money
SQL Server Money Data Type
Repository
https://babelfishpg.org/
https://babelfishpg.org/
Source
babelfish-17-17.7-5.4.0.tar.gz
babelfish-17-17.7-5.4.0.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
babelfish | 1.1.0 | SIM | Apache-2.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9300 | babelfishpg_common | No | Yes | No | Yes | No | Yes | - |
| 9310 | babelfishpg_tsql | No | Yes | No | Yes | No | Yes | - |
| 9320 | babelfishpg_tds | No | Yes | Yes | Yes | No | Yes | - |
| 9330 | babelfishpg_money | No | Yes | No | Yes | Yes | No | - |
special case: this extension only works on wiltondb kernel fork
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.0 | 1817161514 | babelfish | - |
| RPM | PIGSTY | 6.0.0 | 1817161514 | babelfish-$v | antlr4-runtime413 |
| DEB | PIGSTY | 6.0.0 | 1817161514 | babelfish-$v | libantlr4-runtime413 |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 6.0.0 | PIGSTY 5.4.0 | N/A | N/A | N/A |
Build
You can build the RPM / DEB packages for babelfish using pig build:
Install
You can install babelfish directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
The babelfishpg_money extension provides SQL Server-compatible MONEY and SMALLMONEY data type implementations for PostgreSQL as part of the Babelfish project.
Enabling
Data Types
- MONEY - 8-byte monetary value ranging from -922,337,203,685,477.5808 to 922,337,203,685,477.5807, with fixed 4 decimal places
- SMALLMONEY - 4-byte monetary value ranging from -214,748.3648 to 214,748.3647, with fixed 4 decimal places
Behavior
The extension implements SQL Server’s monetary arithmetic rules:
- Fixed-point representation with exactly 4 decimal digits
- SQL Server-compatible rounding behavior for monetary calculations
- Proper casting between MONEY and other numeric types
- Arithmetic operations follow SQL Server semantics (e.g., money / money = money, not float)
Notes
- Part of the Babelfish for PostgreSQL project
- Works in conjunction with
babelfishpg_commonwhich provides the base type infrastructure - The PostgreSQL built-in
moneytype has different precision and behavior; this extension provides the SQL Server-compatible variant
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)