- Notifications
You must be signed in to change notification settings - Fork0
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please seehttp://wiki.postgresql.org/wiki/Submitting_a_Patch
danielcode/postgres
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The original PostgreSQL README file ishere.
This is an experiment to see what happens if SQL isn't used as a wire protocol for relational database access.
The reasoning is as follows:
- Most sophisticated relational database libraries (including ORMs) store queries internally as expression trees.
- These expression trees are converted to SQL for transmission to a database.
- The database then parses the SQL into an expression tree.
- In theory, the expression tree can be passed directly from the client to the server, rather than going throughthe intermediate SQL conversion step.
As at the date of writing (12/16/2012) this is a minimally viable proof of concept:
- It can execute simple SQL arithmetic expressions. (E.g. "select 1 + 2;")
- It can select simple columns from tables (no namespacing, etc.) (E.g. "select first_name from users;")
- It can name selected columns (E.g. "select 2 * 5 as result;")
There are two repositories associated with this experiment:
- A modified version of PostgreSQL that can accept a serialized expression tree.
- A modified version of ruby-pg, the ruby client-side interface for PostgreSQL.This component links to customized PostgreSQL libraries that parse SQL to an expression tree, before passingthat expression tree to the PostgreSQL server.
To be sure you don't break your existing Postgresql installation, we'll install somewhere else:
export INSTALL_PREFIX="${HOME}/test-postgresql"export DB_PREFIX="${HOME}/testdb"export DB_NAME="testdb"
Download, unpack and cd
Build and install
export CFLAGS="-g -fPIC" autoconf ./configure --prefix=${INSTALL_PREFIX} --enable-debug --with-libxml make && make install
Set pathPATH="${INSTALL_PREFIX}/bin:$PATH"; export PATH
Download, unpack and cd
Build and install
rake install_gem
Create databaseinitdb -D ${DB_PREFIX}
Run postgresql serverpostgres -D ${DB_PREFIX}
Create test table
psql ${DB_NAME} create table test (num integer, str varchar(50)); insert into test values (14, 'Test'); ^D
irbrequire 'pg'conn = PG.connect( host: "localhost", dbname: ENV["DB_PREFIX"])x = conn.exec "select * from test;"x.first
My development system runs FreeBSD 9.0. To build in this environment, you must upgrade GCC (I'm using 4.8).
About
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please seehttp://wiki.postgresql.org/wiki/Submitting_a_Patch
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- C94.9%
- C++3.6%
- Perl1.0%
- Shell0.3%
- Nemerle0.1%
- XSLT0.1%