Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/docker/Dockerfile.debian-artifact-build
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ RUN TOOLCHAIN_VER=$(</tmp/.toolchain-ver) && \
--deb-pre-depends "postgresql-${PG_VER}" \
-d "postgresql-${PG_VER}" \
-d "postgresql-server-dev-${PG_VER}" \
-m 'Technology Concepts & Design, Inc. <support@tcdi.com>' \
-m 'Technology Concepts & Design, Inc.' \
--description 'PL/Rust is a loadable procedural language that enables writing PostgreSQL functions in the Rust programming language.' \
-v ${PLRUST_VER} \
--url 'https://github.com/tcdi/plrust' \
Expand Down
14 changes: 10 additions & 4 deletions .licensure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ change_in_place: true
excludes:
- Cargo.toml
- Cargo.lock
- rust-toolchain.toml
- LICENSE
- ".envrc"
- ".gitignore"
- ".dockerignore"
- "doc/book.toml"
- "flake\\..*"
- "logo.*"
- ".github/**/*"
Expand All @@ -14,16 +17,19 @@ excludes:
- ".*\\.md"
- ".*\\.nix"
- ".*\\.yml"
- ".*\\.png"
licenses:
- files: any
ident: PostgreSQL
authors:
- name: Technology Concepts & Design, Inc.
email: opensource@tcdi.com
template: |
Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>

Use of this source code is governed by the [ident] license that can be found in the LICENSE.md file.
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Use of this source code is governed by the PostgreSQL license that can be found in the LICENSE.md file.

comments:
- columns: 120
extensions:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ and that you are satisfied with the existing copyright notice as of opening your
```
Portions Copyright 2020-2021 ZomboDB, LLC.

Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <opensource@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.
```

It is the latter to which copyrights for all merged code is assigned.
6 changes: 6 additions & 0 deletions Dockerfile.try
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Portions Copyright 2021-2025 Technology Concepts & Design, Inc.
#
# All rights reserved.
#
# Use of this source code is governed by the PostgreSQL license that can be
# found in the LICENSE.md file.
# Example of how to build and run this Dockerfile:
# docker build -f Dockerfile.try -t tcdi/try-plrust . # Build the container
# docker run -it tcdi/try-plrust # Run the container
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The PostgreSQL License

Copyright (c): Portions Copyright 2020-2021 ZomboDB, LLC. Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <opensource@tcdi.com>
Copyright (c): Portions Copyright 2020-2021 ZomboDB, LLC. Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ PL/Rust's [documentation](https://tcdi.github.io/plrust) can be found at https:/
Head on over to the PL/Rust [releases page](https://github.com/tcdi/plrust/releases) to get the latest release and check out [the documentation page](https://tcdi.github.io/plrust/install-plrust-on-debian-ubuntu.html) to get started with PL/Rust.


# Join our Community

The PL/Rust team at [TCDI](https://www.tcdi.com/) manages a Discord server where we discuss PL/Rust and related technologies
such as [`pgrx`](https://github.com/tcdi/pgrx), Rust, and Postgres. Feel free to join: https://discord.gg/mHKrj55zyh

# Quick Example

An example PL/Rust function:
Expand Down
3 changes: 0 additions & 3 deletions doc/src/plrust.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ is developed by [TCDI](https://www.tcdi.com).

The following sections discuss PL/Rusts safety guarantees, configuration settings, and installation instructions.




# General Safety, by Rust

Quoted from the "Rustonomicon":
Expand Down
6 changes: 6 additions & 0 deletions plrust-tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#! /bin/bash
# Portions Copyright 2021-2025 Technology Concepts & Design, Inc.
#
# All rights reserved.
#
# Use of this source code is governed by the PostgreSQL license that can be
# found in the LICENSE.md file.

VERSION=$1

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/alter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/argument.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/basic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/blocked_code.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/borrow_mut_error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/ddl.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/dependencies.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
12 changes: 6 additions & 6 deletions plrust-tests/src/fn_call.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand All @@ -17,16 +17,16 @@ mod tests {
fn plrust_fn_call() -> spi::Result<()> {
let sql = r#"
CREATE FUNCTION dynamic_function(i int) RETURNS int LANGUAGE plrust AS $$ Ok(i) $$;

CREATE FUNCTION test_plrust_fn_call() RETURNS int LANGUAGE plrust
AS $$
AS $$
let result = fn_call("dynamic_function", &[&Arg::Value(42i32)]);

assert_eq!(result, Ok(Some(42i32)));

Ok(None)
$$;

SELECT test_plrust_fn_call();
"#;
Spi::run(sql)
Expand Down
18 changes: 9 additions & 9 deletions plrust-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Use of this source code is governed by the PostgreSQL license that can be found in the LICENSE.md file.
*/

mod alter;
mod argument;
mod basic;
Expand All @@ -21,15 +30,6 @@ use pgrx::prelude::*;

pgrx::pg_module_magic!();

/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>

All rights reserved.

Use of this source code is governed by the PostgreSQL license that can be found in the LICENSE.md file.
*/

#[cfg(any(test, feature = "pg_test"))]
#[pgrx::pg_schema]
mod tests {
Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/matches.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/panics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/range.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/recursion.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/return_values.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/round_trip.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/time_and_dates.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/trusted.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/user_defined_types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-tests/src/versioning.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust-trusted-pgrx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "plrust-trusted-pgrx"
version = "1.2.8"
authors = ["TCDI <opensource@tcdi.com>"]
authors = ["TCDI"]
edition = "2021"
license = "PostgreSQL"
description = "Minimal set of `pgrx` rexports for plrust, which the authors have deemed trusted"
Expand Down
7 changes: 7 additions & 0 deletions plrust-trusted-pgrx/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Use of this source code is governed by the PostgreSQL license that can be found in the LICENSE.md file.
*/
//! `plrust-trusted-pgrx` is a re-export crate based on [pgrx](https://crates.io/crates/pgrx) which exposes
//! the minimal set of `pgrx` internals necessary for `plrust` function compilation. `plrust-trusted-pgrx`
//! also includes a number of Rust types for interoperating with Postgres types, access to Postgres'
Expand Down
2 changes: 1 addition & 1 deletion plrust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "plrust"
version = "1.2.8"
authors = ["TCDI <opensource@tcdi.com>"]
authors = ["TCDI"]
edition = "2021"
license = "PostgreSQL Open Source License"
description = "A Trusted Rust procedural language for PostgreSQL"
Expand Down
6 changes: 6 additions & 0 deletions plrust/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash
# Portions Copyright 2021-2025 Technology Concepts & Design, Inc.
#
# All rights reserved.
#
# Use of this source code is governed by the PostgreSQL license that can be
# found in the LICENSE.md file.
set -xe

if [ -z "$STD_TARGETS" ]; then
Expand Down
2 changes: 1 addition & 1 deletion plrust/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
7 changes: 7 additions & 0 deletions plrust/src/allow_list.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Use of this source code is governed by the PostgreSQL license that can be found in the LICENSE.md file.
*/
use crate::gucs::PLRUST_ALLOWED_DEPENDENCIES;
use semver::{BuildMetadata, Comparator, Op, Version, VersionReq};
use std::cmp::Ordering;
Expand Down
2 changes: 1 addition & 1 deletion plrust/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
4 changes: 2 additions & 2 deletions plrust/src/gucs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down Expand Up @@ -57,7 +57,7 @@ pub(crate) fn init() {
);

GucRegistry::define_string_guc(
"plrust.PATH_override",
"plrust.PATH_override",
"The $PATH setting to use for building plrust user functions",
"It may be necessary to override $PATH in order to find compilation dependencies such as `cargo`, `cc`, etc",
&PLRUST_PATH_OVERRIDE,
Expand Down
2 changes: 1 addition & 1 deletion plrust/src/hooks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion plrust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc. <support@tcdi.com>
Portions Copyright 2021-2025 Technology Concepts & Design, Inc.

All rights reserved.

Expand Down
Loading
Loading