dbTalk Databases Forums  

Newbie Questions

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Newbie Questions in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Pushor
 
Posts: n/a

Default Newbie Questions - 09-13-2004 , 02:38 PM






Hi all,

I have an application that for a very specific reason will generate a
row of data that I want to put into a database. One problem is that I
don't know if this data already exists in the database, so should be
performed as an UPDATE, or doesn't and should be performed as an INSERT.
A previous list post touched on a possible solution (trying an UPDATE
and if the rows affected was 0 doing an INSERT). I have a couple
questions regarding this. To further comlicate things, the data is not
normalized. I would like to be able to also add logic to normalize the
data before adding it to the database.

I am good at perl, so I have been looking at the documentation around
PL/Perl.

My questions are:

1) Am I able to somehow do this UPDATE / check rows affected from perl,
or is there a better way (like call a PL/pgSQL function from perl
somehow? is this possible?)

2) Is PL/Perl robust enough (I suppose using DBD::PgSPI) to do what I
want? Am I going down the wrong path?

Thanks for any and all advice!
Tim


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.