On 06/13/2012 03:35 AM, leaf_yxj wrote:
And to dynamically link them into the PostgreSQL executable to run them. Most importantly, you have to COMPLTELY AND UTTERLY TRUST YOUR DEV TEAM. If you let them install a C library they've written, you've given them total power over your database, so they can just use their C function to give themselves superuser privs if they want it. This isn't a bad thing; C functions are extremely fast and powerful tools in a database, you just have to trust the person or people who wrote them. A C library also has much greater opportunity to muck up your database. In particular it can crash database backends very easily. You need to know the people who wrote it are competent and tested it well in a non-production environment. You need to read about "dlopen" or "LoadLibrary", about dynamic linking, about compilation and shared libraries in C, etc. Right now you don't have the background in how this works to make appropriate decisions; you have to either trust your dev team to do the right thing, or tell them to do what they need to without using a C library and accept that may mean you're stopping them from doing their jobs properly.
No, you have to be a superuser to install C functions, because they have *total* access to all of PostgreSQL and can bypass all security and authentication completely. -- Craig Ringer |