OSX Postgres PL/Perl Problem with Finance::Quote/Options

Поиск
Список
Период
Сортировка
От Peter Pan
Тема OSX Postgres PL/Perl Problem with Finance::Quote/Options
Дата
Msg-id BAY157-w458CB0BB7BD5EC07709440A8BD0@phx.gbl
обсуждение исходный текст
Ответы Re: OSX Postgres PL/Perl Problem with Finance::Quote/Options  (Vibhor Kumar <vibhor.kumar@enterprisedb.com>)
Список pgsql-general
Hi@all,

I have a weird problem on dev server (using a Mac Mini 2010 Edt., 10.6.7 OSX).

I use two Perl modules Finance::Quote and Finance::QuoteOptions in a stored PL/Perl procedure which run without problems on a standard LINUX environment (currently in production on CentOS5). Unfortunately on OSX it seems not to be able to properly connect and retrieve the data from Yahoo.

Using the same code in a local perl file (under db user) it works without problems, but fails in the stored procedure. I don't get any compilation errors during import or execution and also no exceptions while the code is executed. As mentioned, the same function works fine under Linux.

Environment:
- OSX 10.6.7
- Postgres 9.0.2 (compiled from source / config options --with-openssl --with-perl --with-libraries=/opt/local/lib --with-includes=/opt/local/include / readline was installed via ports)
- Perl 5.12.3 (compled from source under /usr/local/ linked via enviromentab le variables in .profile / config options ./configure.gnu -des -Duseshrplib --prefix=/usr/local/perl5)

I guess this is some weird behaviour under OSX (one of many) and hopefully somebody stumbled over this already in the past.

Thank you in advance!

cheers,
Alex



Here is a condensed version of the function to illustrate the problem:

CREATE FUNCTION func_test() RETURNS SETOF maxpain AS $$

  use strict;
  #use warnings;
  use Finance::Quote;
  use Finance::QuoteOptions;
  use Time::localtime;
 
    elog(INFO, "Starting Yahoo data retrieval for: C;");

    # YAHOO! DATA RETRIEVAL & PREPARATION
    # Variables
    my @work_array; # Main work array filled with final & calculated values

& nbsp;   my $_stock_symbol = 'C';
   
    # Get Quote Information
    my $q = Finance::Quote->new();
    my %data = $q->fetch('nyse', 'C');
    if (!defined %data) { elog(INFO, "Quote conn. error;");
                          #return_next({status=>3});< font style="" face="Courier New">
                          return undef;
                        }

    # Get Quote Options (Put OI, Call OI, Strike Put/Call etc.)
    my $qf=Finance::QuoteOptions->new('C');
    if (!$qf->retrieve) { elog(INFO, "QuoteOptions conn. errors");
                         return undef;
                        }
$$ LANGUAGE plperlu;

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

Предыдущее
От: Harald Armin Massa
Дата:
Сообщение: Re: postgresql-9.0 service starting problem
Следующее
От: "Hans C. Poo"
Дата:
Сообщение: Perl script to drop duplicated constraints definitions