Search Postgresql Archives

Re: Standalone Parser for PL/pgSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 14, 2005 at 03:38:43PM +0000, Matt Miller wrote:

> > > The main parser depends (at least) on the List handling and memory
> > > handling.
> > 
> > The PL/PgSQL parser also depends on these, although to a lesser degree.
> 
> I suppose these dependencies are okay as long as I can just link my
> parser to a library (e.g. src/pl/plpgsql/src/libplpgsql.so) and
> everything magically works.

Hmm, those symbols are defined in the main Postgres executable, so
there's no shared library to rely on.  Anyway, for the memory allocation
stuff, you should be able to

#define palloc(a) malloc(a)
#define pfree(a) free(a)

and define AllocSetContextCreate() and other MemoryContext calls defined
as no-ops.  It will leak memory like crazy, but for a short-lived
program I don't think it's a problem.

list.c you'll have to take from src/backend/nodes/list.c, I don't think
it should be too difficult.

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... ¿Quién es el machito que tendría carnet?"  (Mafalda)

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux