Newbie Questions

Поиск
Список
Период
Сортировка
От Tim Pushor
Тема Newbie Questions
Дата
Msg-id 4145F723.2090004@crossthread.com
обсуждение исходный текст
Список pgsql-novice
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


В списке pgsql-novice по дате отправления:

Предыдущее
От: Mike Ellsworth
Дата:
Сообщение: Subnovice question
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: nextval() clarification