Search Postgresql Archives

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

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

 



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 = "" '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;

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux