Re: Standalone Parser for PL/pgSQL

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Standalone Parser for PL/pgSQL
Дата
Msg-id 20050714162550.GB19778@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Standalone Parser for PL/pgSQL  (Matt Miller <mattm@epx.com>)
Список pgsql-general
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)

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: ERROR: could not open relation
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Standalone Parser for PL/pgSQL