Re: creating a custom server

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Keary Suska <hierophant(at)pcisys(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: creating a custom server
Date: 2001-10-18 22:01:15
Message-ID: Pine.BSO.4.10.10110181755130.7220-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 18 Oct 2001, Keary Suska wrote:

> > First, sorry if this is off topic. Second, WARNING: broken english
> > ahead :)
> >
> > Is it possible to create a 'custom' server which can accept normal
> > connections from normal clients, but use different language (or just
> > 'proxy' the queries to the real server)? A friend of mine told me this
> > is a feature of some commercial sql server. What I acutaly want to do
> > is to add another layer between the client and the server.
> >
> > For example, a client connects and issues a query like 'show sessions'.
> > My server checks if the client has permission (according to a table in
> > postgres) and then 'translates' the query to 'select * from sessions' or
> > something else. The result is then sent back to the client (possibly
> > modified).
What your friend is talking about is probably Sybase Open Server.

This is usually done using some sort of middleware, but in case of
postgresql, you can do something similar to it using plperl.

The idea here is not just translation of queries, but providing
higher-level abstraction for client-server interaction, not just a query
taking a finite number of arguments that returns recordset, but a request
containing serialized data structure returning another serialized data
structure. Each structure can be arbitrarily complex (hash of array of
hashes, for example), as long is it can be serialized and deserialized.

pl/perl is a perl programming language for postgresql, you can write a
stored procedure that will accept a binary string that represents a
serialized structure, and returns the same.

Let me know if I can explain it further.

-alex

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2001-10-18 22:05:29 Re: Backup Postgre Windows to Linux
Previous Message Rich Shepard 2001-10-18 22:00:07 Possible bug in postgresql-7.1.3-1PGDG