faker
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
faker | 0.5.3 | LANG | PostgreSQL | Python |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3210 | faker | No | Yes | No | Yes | No | No | - |
Requires PL/Python3 and Python Faker; the PIGSTY DEB carries a PG17+ parser compatibility patch.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 0.5.3 | 1817161514 | faker | plpython3u |
| RPM | PGDG | 0.5.3 | 1817161514 | postgresql_faker_$v | - |
| DEB | PIGSTY | 0.5.3 | 1817161514 | postgresql-$v-faker | postgresql-plpython3-$v, python3-fake-factory |
Build
You can build the DEB packages for faker using pig build:
Install
You can install faker directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
faker is a PostgreSQL extension that wraps Python’s Faker library, providing functions to generate realistic fake data directly in SQL queries. It requires plpython3u.
Generate Fake Data
Note: faker.date() and faker.time() are not available because date and time are reserved PostgreSQL keywords. Use faker.date_between() or faker.date_this_century() instead.
Populate Tables with Fake Data
Localized Fake Data
Locale is set per session, not per function call:
Unique Values
Use the unique_ prefix to guarantee unique values within a session:
Discover All Functions
All faker functions return text. Cast explicitly for other types.
Common Faker Providers
| Function | Description |
|---|---|
faker.name() | Full name |
faker.first_name() | First name |
faker.last_name() | Last name |
faker.email() | Email address |
faker.company_email() | Company email |
faker.phone_number() | Phone number |
faker.address() | Full address |
faker.city() | City name |
faker.country() | Country name |
faker.company() | Company name |
faker.text() | Random text |
faker.date_this_century() | Random date |
faker.ssn() | Social security number |
faker.ean() | EAN barcode |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)