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

Re: Talking to Postgres from C



On Mon, 2009-02-02 at 09:03 -0800, Chris Travers wrote:
> On Mon, Feb 2, 2009 at 8:57 AM, beamends <..hidden..> wrote:
> > Hi All,
> > not strictly LSMB, but does anyone have a pointer to a primer for
> > reading and writing to Postgres/LSMB from C - I'm looking to update
> > prices from suppliers CSV files and can't get my head round SQL at all
> > I'm affraid.
> 
> What exactly are you trying to do?  The db speaks "SQL" to most client
> programs, so if you are trying to write a libpq client, you wil still
> be tied to SQL.
> 
> If OTOH, you are trying to write a stored proc in C using an interface
> called "SPI" you might be able to get around some of the SQL, but not
> all.
> 
> I would be more than happy to provide some services to you in this
> area, however it would probably be in Perl and SQL.  In your case, I
> would suggest that you look into using temporary tables and holding
> tables.  This can often simplify the SQL quite a bit.
> 
> Best Wishes,
> Chris Travers

Hi Chris,
I'm just after a simple program to read through the suppliers CSV file
by line, read the db, if the price has changed record the fact and do
the next one. Depending on how that works out the next step would be to
look at the Genuine Parts price (which is on the same line) and then
maybe look to automate the price updating - but alas there is no
standard markup so some sort of interaction will be needed.

I can cope with a simple SQL query, done many times - but get rapidly
lost when doing anything, well, er, useful!

Cheers
Richard
  
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Ledger-smb-users mailing list
> ..hidden..
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-users