Re: Accessing Database Data from C Function - Mailing list pgsql-general

From Steve Atkins
Subject Re: Accessing Database Data from C Function
Date
Msg-id 95DF46DD-CE9E-4906-BEB7-05F0DA56E69C@blighty.com
Whole thread Raw
In response to Re: Accessing Database Data from C Function  ("Jeffrey Bigham" <jbigham@cs.washington.edu>)
List pgsql-general
On Aug 8, 2006, at 8:33 PM, Jeffrey Bigham wrote:

>
>> Do you have a reason to use C instead of a higher-level language?
>
> 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?

It depends on what you're doing. I've found plpgsql to be a better
match for a lot of purposes, as it has a much better "impedance
match" with the database. I'm a happy C hacker, and use C for
PG functions where it seems appropriate, but use plpgsql for
 >90% of my in database work. Performance is probably marginally
slower than C, but development time for day-to-day triggers and
functions is a lot faster. Much easier to maintain, too.

Cheers,
   Steve


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Too many open files from postgres.
Next
From: Michael Fuhr
Date:
Subject: Re: Connection string