Search Postgresql Archives

Re: Accessing Database Data from C Function

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

 



On 8/8/06, Jeffrey Bigham <jbigham@xxxxxxxxxxxxxxxxx> wrote:
Not really.  Basically I know C decently enough and would have to
learn PL/pgSQL (although it looks pretty easy).  Perl sounds quite
attractive for the added benefit of text-processing as you mention.  I
also have some vague understanding that C might be faster.  I hope I'm
not opening a can-of-worms, but is C actually faster?

IMO, pl/pgsql should be the first sp language you learn and the
primary language of development for strored procedures.  It is simply
better than most other pl languages for data processing and ease of
maitenance.

There are two reasons why you might want to use C: one is that you
might want to interface with a C library and make it callable from
SQL.  You should check out Magnus Hagander's integration of OpenLDAP
for a good example of this (check his blog).  Note that  Magnus who is
in my opinion an expert C programmer only did this after trying ther
perl implementation and finding it unworkable.

another reason to use C is to expose some database internals.  for
example, in C you can invoke a function by it's oid which is currently
impossible to do in sql/plpgsql without some serious acrobatics.

Aside from that, I would avoid.  One of the reasons databases were
invented was so we don't have to use C for data processing (or COBOL,
etc.), or at least not until the hard work has already been done.

merlin


[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