Skip site navigation (1) Skip section navigation (2)

Re: Access to current database from C-language function

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Achim Domma <domma(at)procoders(dot)net>, Florian Pflug <fgp(at)phlo(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Access to current database from C-language function
Date: 2011-08-01 15:18:36
Message-ID: CA+TgmoYvo7WGRi0BsttpmoVAJM=NO12+TK1nhm_TTQZv9Cn1+g@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Mon, Aug 1, 2011 at 11:04 AM, David Fetter <david(at)fetter(dot)org> wrote:
> SQL is Turing-complete, so the chances are excellent that it's
> possible to express that algorithm in it. ;)
>
> Look into common table expressions for iteration/recursion, and
> windowing functions, commonly used for time series.
>
> http://www.postgresql.org/docs/current/static/queries-with.html
> http://www.postgresql.org/docs/current/static/tutorial-window.html

That doesn't guarantee that it can be expressed efficiently, though.
I think the OP may be going overboard by trying to bypass SPI, but
putting the logic inside the server seems like it could well be
worthwhile.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

pgsql-hackers by date

Next:From: Jeff DavisDate: 2011-08-01 15:21:19
Subject: Re: lazy vxid locks, v3
Previous:From: David FetterDate: 2011-08-01 15:04:58
Subject: Re: Access to current database from C-language function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group