Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leto/plparrot
Embed Parrot+Rakudo into PostgreSQL
https://github.com/leto/plparrot
Last synced: 2 months ago
JSON representation
Embed Parrot+Rakudo into PostgreSQL
- Host: GitHub
- URL: https://github.com/leto/plparrot
- Owner: leto
- License: artistic-2.0
- Created: 2009-10-24T00:03:40.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2013-09-16T05:29:08.000Z (over 11 years ago)
- Last Synced: 2024-06-12T18:58:18.370Z (7 months ago)
- Language: Elixir
- Homepage: http://pl.parrot.org
- Size: 2.17 MB
- Stars: 27
- Watchers: 11
- Forks: 5
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY
- License: LICENSE
Awesome Lists containing this project
README
# PL/Parrot
PL/Parrot is a PostgreSQL procedural language for the Parrot Virtual Machine.
# Installation
For the impatient, to install PL/Parrot into a PostgreSQL database, just do this:
make
make install
make installcheckIf you get an error such as:
Makefile:13: /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target `/usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk'. Stop.then you probably installed postgres from a debian package. You need to install the
postgresql-server-dev-X package, where X is your version of PostgreSQL. For example:sudo apt-get install postgresql-server-dev-8.4
To run the tests with pg_prove you should create the plpgsql language in your database.
The default database name is your current username, so this should work:createlang plpgsql $USER
make testIf you encounter an error such as:
"Makefile", line 8: Need an operator
You need to use GNU make, which may well be installed on your system as
'gmake':gmake
gmake install
gmake installcheckIf you encounter an error such as:
make: pg_config: Command not found
Be sure that you have `pg_config` installed and in your path. If you used a
package management system such as RPM to install PostgreSQL, be sure that the
`-devel` package is also installed. If necessary, add the path to `pg_config`
to your `$PATH` environment variable:env PATH=$PATH:/path/to/pgsql/bin \
make && make install && make installcheckAnd finally, if all that fails, copy the entire distribution directory to the
`contrib/` subdirectory of the PostgreSQL source tree and try it there without
the `$USE_PGXS` variable:make NO_PGXS=1
make install NO_PGXS=1
make installcheck NO_PGXS=1If you encounter an error such as:
ERROR: must be owner of database regression
You need to run the test suite using a super user, such as the default
"postgres" super user:make installcheck PGUSER=postgres
# Testing PL/Parrot with PL/Parrot
In addition to the PostgreSQL-standard `installcheck` target, the `test`
target uses the `pg_prove` Perl program to do its testing, which requires
TAP::Harness, included in
[Test::Harness](http://search.cpan.org/dist/Test-Harness/ "Test::Harness on
CPAN") 3.x. You'll need to make sure that you use a database with PL/pgSQL
loaded, or else the tests won't work. `pg_prove` supports a number of
environment variables that you might need to use, including all the usual
PostgreSQL client environment variables:* `$PGDATABASE`
* `$PGHOST`
* `$PGPORT`
* `$PGUSER`You can use it to run the test suite as a database super user like so:
make test PGUSER=postgres
Of course, if you're running the tests from the `contrib/` directory, you
should add the `NO_PGXS` variable.# Adding PL/Parrot to a Database
Once PL/Parrot has been built and tested, you can install it into a
PL/pgSQL-enabled database:psql -d dbname -f plparrot.sql
If you want PL/Parrot to be available to all new databases, install it into the
"template1" database:psql -d template1 -f plparrot.sql
The `plparrot.sql script will also be installed in the `contrib` directory
under the directory output by `pg_config --sharedir`. So you can always do
this:psql -d template1 -f `pg_config --sharedir`/contrib/plparrot.sql
# License
This code is distributed under the terms of the Artistic License 2.0.
For more details, see the full text of the license in the file LICENSE.