Re: [HACKERS] char types gone.

Поиск
Список
Период
Сортировка
От Mattias Kregert
Тема Re: [HACKERS] char types gone.
Дата
Msg-id 3517C4B3.4E0A7393@algonet.se
обсуждение исходный текст
Ответ на Re: [HACKERS] char types gone.  (darrenk@insightdist.com (Darren King))
Ответы Re: [HACKERS] char types gone.  (ocie@paracel.com)
Список pgsql-hackers
Darren King wrote:
>
> Would be nice if stuff like that (and the money and geometrics) could be
> compiled in in the same manner that Apache is a basic web server that lets
> you pick and choose modules/features you want to build into it.
>
> I don't know how big of a performance boost it provides in the cache, but
> removing the functions associated with the char types shrank the pg_proc
> table from 906 to 842 entries or a bit over 7%.
>
> Want to shrink it further?  Of those remaining 842, _230_ are for the geometric
> types!  Throw in 25 more for the cash/money functions.  Bloat city if you
> never use these things.  Thirty percent could be moved out to contrib and
> not missed by most postgres users.
>
> I think a reasonable goal is to provide an sql server that meets the current sql
> standard with the possibility of having other types and functionality available
> as modules.  These modules could be made into the template1 at compile time
> or made and installed on a per-database basis.  Make your server and database
> with whatever you want in it.

The problem with the contrib stuff is that most users find it too
difficult to dig around in that dir and make and install stuff. The
"contrib" name also give me the feeling that this is unsupported
stuff/beta/not-to-be-used-in-production/to-be-removed etc.

The nicest thing would be if contrib was changed to "modules", and
everything was compiled and installed in /usr/local/pgsql/modules/.
Then the user could install them by typing "INSMOD ORACLE" and then
/usr/local/pgsql/modules/oracle/insmod.sql would be executed and
install shared libraries and sql commands. "RMMOD ORACLE" would
do the opposite. Just like Linux modules.
Perhaps it would even be possible to autoload modules if the modules
directories contains a file with commands/functions listed, which
would be searched automagically...

This is the idea:

psql-> SET MODULES TO AUTOLOAD;
NOTICE: 100 Modules will now load automagically.
psql-> SELECT MYFUNKYFUNC('hello');
NOTICE: 202 Unknown function 'MYFUNKYFUNC(text)'
NOTICE: 100 Module 'MYFUNCTIONS' loaded.
myfunkyfunc
-------------------
the word is 'hello'

(1 row)

psql-> INSMOD ORACLE;
NOTICE: 100 Module 'ORACLE' loaded.
NOTICE: 110 Module description: Oracle(tm) compatability module. Version
1.0.
psql-> LSMOD;
NOTICE: 100 MYFUNCTIONS ORACLE
psql-> RMMOD VERBOSE MYFUNCTIONS;
NOTICE: 100 Module 'MYFUNCTIONS' removed.
NOTICE: 120 Functions removed: Myfunkyfunc(text) Myotherfunc(int)
Mylastfunc(float)
NOTICE: 120 Commands removed: Myfunkycommand


Is it possible to register commands dynamically in the parser?

/* m */

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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] Data type removal
Следующее
От: darrenk@insightdist.com (Darren King)
Дата:
Сообщение: Re: [HACKERS] char types gone.