random
random data generator
pg_random : random data generator
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4790 | random | pg_random | 2.0.0 |
FUNC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | faker dbt2 tsm_system_time tsm_system_rows pg_mockable pgsqlmock pgtap omni_test |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.0.0 |
18 17 16 15 14 | pg_random |
- |
| RPM | PIGSTY | 2.0.0 |
18 17 16 15 14 | pg_random_$v |
- |
| DEB | PIGSTY | 2.0.0 |
18 17 16 15 14 | postgresql-$v-random |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| el8.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| el9.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| el9.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| el10.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| el10.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| d12.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| d12.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| d13.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| d13.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| u22.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| u22.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| u24.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| u24.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| u26.x86_64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
| u26.aarch64 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 | PIGSTY 2.0.0 |
Source
github.com/tvondra/random
random-2.0.0-dev.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Provides functions to generate random values for various data types with reproducible output controlled by a seed.
Functions
All functions accept seed (for reproducibility) and nvalues (number of distinct values).
| Function | Description |
|---|---|
random_string(seed, nvalues, min_length, max_length) |
Random ASCII string |
random_bytea(seed, nvalues, min_length, max_length) |
Random bytea |
random_int(seed, nvalues, min_value, max_value) |
Random 32-bit integer |
random_bigint(seed, nvalues, min_value, max_value) |
Random 64-bit integer |
random_real(seed, nvalues, min_value, max_value) |
Random 32-bit float |
random_double_precision(seed, nvalues, min_value, max_value) |
Random 64-bit float |
random_inet(seed, nvalues) |
Random INET address (/32 mask) |
random_cnet(seed, nvalues) |
Random CIDR with masks 8/16/24/32 |
random_cnet2(seed, nvalues) |
Random CIDR with equal fraction per mask length |
random_macaddr(seed, nvalues) |
Random 6-byte MAC address |
random_macaddr8(seed, nvalues) |
Random 8-byte MAC address |