Questions tagged [postgresql-extensions]

Custom user defined functions written as either stored procedures using SQL and PL/pgSQL or via C that extend the functionality of PostgreSQL

The PostgreSQL RDBMS (relational database management system) allows for users of a PostgreSQL installation to extend the base functionality of SQL via user written code. This code comes in the form of stored procedures, written in SQL or PL/pgSQL, and C source code.

A user may want to extend the functionality of SQL to perform complex operations or aggregations of a database that are not present in SQL or PostgreSQL, or to increase performance by avoiding shipping query results to another host in order to operate on the results using the logic of another application.

The official PostgreSQL documentation is a excellent starting point to begin extending SQL, specifically Chapter 38: Extending SQL. For writing SQL functions, refer to Chapter 38.5: Query Language (SQL) Functions of PostgreSQL's documentation. Information on using the PL/pgSQL procedural language can be found in Chapter 43: PL/pgSQL - SQL Procedural Language. And finally, reference Chapter 38.10: C-Language Functions to learn about writing custom user defined functions for PostgreSQL in C.

Some additional worthwhile resources include the following blog posts and PostgreSQL wiki article:

Several examples of extending SQL via PostgreSQL extensions can also be found in the contrib directory of PostgreSQL's source code.

75 questions
1
vote
1 answer

String manipulation by C language function of PostgreSQL

I'd like to create a postgresql c-Language function whose arguments and return values are varchar and which uses Char [] during processing. But, it does not work as expected. I made a program of c like this. #include #include…
Yuwaz
  • 383
  • 1
  • 4
  • 19
1
vote
1 answer

Postgresql :unable to Install HTTP extension on Amazon RDS

I am trying to get response from API into Postsgresql. For this I have installed respective HTTP extension from http://www.postgresonline.com/journal/archives/371-http-extension-for-windows-64-and-32-bit.html In my local system . Current issue is…
1
vote
0 answers

postgres extension pg_background on debian

I have several servers where I need to install postgres 9.6 with the extension pg_background. But this extension is not in the "postgresql-contrib" package. The extension source and instructions are…
1
vote
1 answer

How to write a custom struct data type for PostgreSQL using internal types

I am using PostgreSQL 9.6. I would like to create a new currency type extension on PostgreSQL that contains a string and a numerical value. According to the documentation https://www.postgresql.org/docs/9.6/static/sql-createtype.html, I can use…
Sylvain
  • 542
  • 6
  • 20
1
vote
2 answers

release postgresql extension

I'm developing application that holds data in postgres. So i must prepare database before working with application, there must be created few tables. I'm creating this tables by running sql code but i think it's not convenient after i found this…
Alexander Kondaurov
  • 3,677
  • 5
  • 42
  • 64
1
vote
2 answers

How to find the database name in netezza in which SQL Extensions Toolkit is intalled?

I am trying to find out the database in which SQL Extensions Toolkit was installed.
Ashutosh
  • 75
  • 1
  • 10
1
vote
1 answer

PostgreSQL 9.6.1 extensions with Visual Studio 2015

I am trying to add POWA to my PostgreSQL installation. In order to do that I have to add an extension called pg_stat_statements. Since I am on windows platform I have to create a DLL of this extension and add it to the lib folder of PostgreSQL. I…
user3112250
  • 53
  • 1
  • 10
1
vote
1 answer

Postgresql-8.4: undefined symbol: palloc

I'm trying to set up a database and have to create a function: create or replace function uuid() returns uuid as 'moss_uuidgen', 'moss_uuidgen' language 'C' strict; Every time I execute that postgre tells me that in the .so file there is an…
McLayan
  • 21
  • 6
1
vote
1 answer

Catching SQL errors during rails migrations - in order to fail silently

I am trying to catch an error while running a rails migration (rake db:migrate) so that it can fail silently. I want to enable the RDKit extension on my PostgreSQL database, but only if it is available in the PostgreSQL installation. My rescue code…
Louis
  • 822
  • 9
  • 12
1
vote
1 answer

Can create extension but can't alter in PostgreSQL

The extension was created by user deploy with: CREATE EXTENSION ltree; now I need to move extension to another schema (still as a deploy user, schema utils is owned by deploy user too). So I do: ALTER EXTENSION ltree SET SCHEMA utils; which fails…
Dmytrii Nagirniak
  • 23,696
  • 13
  • 75
  • 130
0
votes
2 answers

PostgreSQL Extension: "could not load library" error while creating C-based Extension

I am facing an issue while trying to create a C-based PostgreSQL extension. I have the extension code available in my GitHub repository, and I am trying to load it using the CREATE EXTENSION command in PostgreSQL. However, I am encountering the…
Ishaan Adarsh
  • 197
  • 1
  • 11
0
votes
1 answer

PostgreSQL PL/Python Extension - Function Not Returning Expected Result

I am facing an issue with a PostgreSQL extension using plpython3u. I have created a simple extension with a Python function that is supposed to add two numbers. However, when I execute the function, it returns an empty result instead of the expected…
Ishaan Adarsh
  • 197
  • 1
  • 11
0
votes
1 answer

How to install PL/Python on Postgres (Homebrew)

I have installed Postgresql@14 on my system using homebrew. I want to install pl/python on my database but on running the command CREATE EXTENSION plpython3u; ERROR: could not open extension control file…
Ishaan Adarsh
  • 197
  • 1
  • 11
0
votes
0 answers

Issue in Installing PL/Python on Postgres

I want to install PL/Python on my postgres database. I am using a binary manager on postgres pgenv. These are the steps I am following to install the procedural language: I have downloaded the PL/Python source code from the PostgreSQL contrib…
Ishaan Adarsh
  • 197
  • 1
  • 11
0
votes
0 answers

Build error plv8 - using the make command

After downloading source code by executing commands: $ wget https://github.com/plv8/plv8/archive/v3.0.0.tar.gz $ tar -xvzf v3.0.0.tar.gz $ cd plv8-3.0.0 $ make Getting an error after running the make command mkdir -p build cd build; git clone…
Ishaan Adarsh
  • 197
  • 1
  • 11