• Stars
    star
    110
  • Rank 315,073 (Top 7 %)
  • Language
    C
  • Created over 15 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PL/Ruby procedural language for the PostgreSQL database system by Guy Decoux

PL/ruby

PL/Ruby is a loadable procedural language for the PostgreSQL database system that enables the Ruby language to create functions and trigger procedures.

Prerequisite

  • ruby 1.8.7 or later (maybe 1.8.6 too)
  • postgresql >= 7.3

All PostgreSQL headers need to be installed. Command (see INSTALL in the directory postgresql-7.x.y)

    make install-all-headers

Installation

    ruby extconf.rb
    make
    make install

You may need to specify some of the following extconf.rb options:

    --with-pg-config=<location of the pg_config command of PostgreSQL>

Specifies the location of pg_config. e.g. --with-pg-config=/usr/local/bin/pg_config

    --with-greenplum

Builds plruby for Greenplum instead of PostgreSQL.

    --disable-conversion

By default plruby tries to convert a postgres type to a ruby class. This option gives the possibility to disable all conversions.

   --with-suffix=<suffix to add>

Specifies a suffix to add to the extension module file. e.g. ruby extconf.rb --with-suffix=_geo will create plruby_geo.so.

    --with-safe-level

Lowers the safe level which the plruby functions are run under. (default: 12; meaning the maximum)

    --with-timeout=<seconds>

Sets the timeout for each function call. (default: none)

    --with-main-safe-level

Lowers the safe level which the main thread waiting for timeouts is run under. (default: 3) This option is read only when --with-timeout is given.

Test (and examples)

WARNING: if plruby was compiled without --disable-conversion you must FIRST run make install before make test.

    make test

This will run the following two commands:

    ( cd test/plt; ./runtest )
    ( cd test/plp; ./runtest )

The database plruby_test is created and then destroyed. Don't use it if you have such a database.

Now you are ready to create the PL/Ruby language in PostgreSQL.

Since the pg_language system catalog is private to each database, the new language can be created only for individual databases, or in the template1 database. In the latter case, it is automatically available in all newly created databases.

The commands to create the new language are:

    create function plruby_call_handler () returns language_handler
    as 'path-to-plruby-shared-lib'
    language 'C';

    create trusted language 'plruby'
    handler plruby_call_handler
    lancompiler 'PL/Ruby';

The trusted keyword on create language tells PostgreSQL, that all users (not only those with superuser privilege) are permitted to create functions with LANGUAGE 'plruby'. This is absolutely safe, because there is nothing a normal user can do with PL/Ruby, to get around access restrictions he/she has.

Documentation

see plruby.rd and plruby.html

Development

New releases and sources can be obtained from http://github.com/knu/postgresql-plruby

Copying

This extension module is copyrighted free software by Guy Decoux.

You can redistribute it and/or modify it under the same term as Ruby.


Guy Decoux [email protected] (original author, deceased in July 2008) Akinori MUSHA [email protected] (current maintainer)

More Repositories

1

elscreen

elscreen patched to work with recent Emacs
Emacs Lisp
168
star
2

noreferrer

Cross-browser support for HTML5's noreferrer link type.
CoffeeScript
129
star
3

ruby-domain_name

Domain Name manipulation library for Ruby
Ruby
95
star
4

ruby-unf

A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
Ruby
75
star
5

zsh-git-escape-magic

zle tweak for git command line arguments
68
star
6

Knu.spoon

A Spoon package of my Hammerspoon modules, mainly for keyboard customization
Lua
51
star
7

zsh-manydots-magic

manydots-magic - zle tweak for emulating `...'==`../..' etc.
Shell
39
star
8

ruby-unf_ext

Unicode Normalization Form support library for CRuby
Hack
32
star
9

e

e - a smart wrapper for $EDITOR
Shell
29
star
10

ruby-mmap

Ruby bindings for Unix mmap(2) by Guy Decoux
C
25
star
11

git-merge-structure-sql

git merge driver for db/structure.sql of Rails projects
Ruby
24
star
12

mc-extras.el

Extra functions for multiple-cursors mode
Emacs Lisp
24
star
13

webrobots

A Ruby library to help write robots.txt compliant web robots
Ruby
24
star
14

easy-kill-extras.el

Extra functions for easy-kill/easy-mark.
Emacs Lisp
23
star
15

emacsc

Emacs as a command line tool
Perl
18
star
16

ruby-friendfeed

A Ruby library to provide access to FriendFeed API's
Ruby
17
star
17

rsdl

The interpreter wrapper for Ruby/SDL (written by kumaryu)
Ruby
14
star
18

imedic-shogi

Shogi terminology dictionary for Japanese input method editors
13
star
19

ruby-bdb

Ruby bindings for Sleepycat Berkeley DB and DB XML by Guy Decoux
C
13
star
20

sorted_set

SortedSet for Ruby
Ruby
13
star
21

operate-on-number.el

Operate on number at point with arithmetic functions
Emacs Lisp
13
star
22

kakasi_ffi

A Ruby binding for KAKASI implemented with FFI
Ruby
12
star
23

di

A wrapper around GNU diff(1)
Ruby
10
star
24

phi-search-mc.el

Multiple-cursors extension for phi-search
Emacs Lisp
10
star
25

FDclone

A clone of FD (File & Directory tool) by T.Shirai
C
10
star
26

yaml-imenu.el

Enhancement for the imenu support in yaml-mode
Emacs Lisp
8
star
27

dired-fdclone.el

dired functions and settings to mimic FDclone
Emacs Lisp
8
star
28

ruby-digest-tiger

Modules related to message digesting algorithms that conform to the standard Digest API (ext/digest)
C
7
star
29

zfs-snapshot-clean

A tool to sieve ZFS snapshots as per given spec a la `pdumpfs-clean'
Shell
7
star
30

inplace

A command line utility that edits files in-place through given filter commands
Ruby
6
star
31

replace-with-inflections.el

Provides query-replace-names-with-inflections
Emacs Lisp
6
star
32

g

g, f - stress-free wrapper around grep(1) and find(1)
Shell
6
star
33

imedic-mahjong

Mahjong terminology dictionary for Japanese input method editors
5
star
34

github-sync

A simple script to check out all of your projects on GitHub under your local directory (${GITHUB_DIR-$HOME/src/github}).
Ruby
5
star
35

sidetiq-timezone

Time zone for Sidetiq
Ruby
5
star
36

fuse-convmvfs

A userland file system to convert filename charset, by ZC Miao
HTML
5
star
37

sh-functions

A place to put utility functions for shell scripting
Shell
4
star
38

shell-toggle.el

Toggle to and from the *shell* buffer
Emacs Lisp
4
star
39

bcbiff

bcbiff(1) - Boxcar based IMAP biff
Ruby
4
star
40

stow-utils

Complementary utilities for GNU stow (http://www.gnu.org/software/stow/)
4
star
41

plum

An IRC proxy with plug-in architecture, Japanese encodings and UTF-8 support, IPv6, etc. written in legacy perl
4
star
42

ruby-perlstorable

A Ruby module that emulates deserialization of Perl's Storable module
Ruby
4
star
43

ruby-qrencode

Ruby bindings for libqrencode, a QR code encoder library
C
3
star
44

ruby-bdb1

Ruby bindings for Berkeley DB 1.8x by Guy Decoux
C
3
star
45

ical_events

A programmer-friendly frontend for Ali Rantakari's amazing icalBuddy
Ruby
3
star
46

zsh-shell-word-at-point

zle function to get a shell word at point
Shell
3
star
47

zsh-easy-vcs-status

A zle tweak for easy access to VCS status
Shell
3
star
48

p

p - a lazy wrapper for $PAGER
Shell
3
star
49

imerge

a shell script that helps merge one file to another interactively
Shell
3
star
50

tmux-open-anything

Shell
2
star
51

azik

AZIKε…₯εŠ›
2
star
52

vc-svk.el

vc-svk.el fixed/updated for Emacs trunk
Emacs Lisp
2
star
53

lookup.el

lookup.el cvsimported from :pserver:[email protected]:/cvsroot/lookup and modified for recent Emacs
Emacs Lisp
2
star
54

prom-wl.el

Prom-WL (Procmail reader for Wanderlust) - fixed for recent Emacs and Wanderlust
Emacs Lisp
2
star
55

screen

GNU screen with some patches applied
C
2
star
56

netatalk

Netatalk Sourceforge mirror providing advanced github code inspection tools
C
2
star
57

ruby-bz2

Ruby bindings for libbzip2 by Guy Decoux
C
2
star
58

wp-syntax-download-extension

This plug-in makes WP-Syntax highlighted code snippets downloadable from nice captions.
PHP
2
star
59

poly-ruby.el

Provides poly-ruby-mode for Emacs
Emacs Lisp
2
star
60

sup

do <whatever SCM> update
Shell
2
star
61

minibuffer-complete-cycle

Cycle through the *Completions* buffer
Emacs Lisp
2
star
62

libchk

libchk(1) -- a tool to check shared library links (only FreeBSD is supported for the moment)
Ruby
1
star
63

kippu_problem

Kippu Problem - Make four digits equal to 10 by only using four arithmetic operations and parentheses
Ruby
1
star
64

ruby-digest-whirlpool

Ruby interface to the Whirlpool message digest algorithm
C++
1
star
65

atok-google_suggest

A Google Suggest plug-in for ATOK Direct.
Ruby
1
star
66

jsonapi-example

Ruby
1
star
67

docset-presto

Presto DB Docset builder for Dash.app
Ruby
1
star
68

rubigame

RubiGame is a clone of a famous puzzle game
Ruby
1
star
69

zsh-delsel-mode

delsel-mode (delete-selection-mode) for zsh
Shell
1
star
70

docset-trino

Presto Docset builder for Dash.app
Ruby
1
star
71

yoursearch

Build OpenSearch plugins your way
Ruby
1
star