Thread

  1. this one's simpler

    Eric J McKeown <ericm@palaver.net> — 1998-08-25T00:06:45Z

    Ok, I think this questions is a little bit easier.  I have this piece of
    code:
    
    select (max(date_asked) - min(date_asked))::timespan from questions ;
    
    And it produces this output:
    
    timespan
    ------------------------------------
    @ 2334 days 13 hours 21 mins 45 secs
    (1 row)                             
    
    Now, what I'd really like is a way to format that output into months so
    that I could see the difference between the two dates in terms of months.
    Pointers??
    
    TIA...
    
    eric
    
    _______________________
    Eric McKeown
    ericm@palaver.net
    http://www.palaver.net
    
    
    
  2. Re: [SQL] this one's simpler

    Maarten Boekhold <maartenb@dutepp2.et.tudelft.nl> — 1998-08-25T07:40:58Z

    On Mon, 24 Aug 1998, Eric McKeown wrote:
    
    > Ok, I think this questions is a little bit easier.  I have this piece of
    > code:
    > 
    > select (max(date_asked) - min(date_asked))::timespan from questions ;
    > 
    > And it produces this output:
    > 
    > timespan
    > ------------------------------------
    > @ 2334 days 13 hours 21 mins 45 secs
    > (1 row)                             
    > 
    > Now, what I'd really like is a way to format that output into months so
    > that I could see the difference between the two dates in terms of months.
    > Pointers??
    
    Well, since not every month has the same number of days, and not every 
    *year* has the same number of days, I think this would only be possible 
    if you also give same starting date (ie min(date_asked)). I'd try to
    write a C-function for this I guess.
    
    Maarten
    
    _____________________________________________________________________________
    | TU Delft, The Netherlands, Faculty of Information Technology and Systems  |
    |                   Department of Electrical Engineering                    |
    |           Computer Architecture and Digital Technique section             |
    |                          M.Boekhold@et.tudelft.nl                         |
    -----------------------------------------------------------------------------
    
    
    
  3. Having problems to compile SPI

    Dave <david@morgana.estadistica.unam.mx> — 1998-08-25T18:07:11Z

    Hi.
    
    I hope this is not a too much trivial question.
    
    I'm having problems when compiling a new SPI function. I've been doing it
    with :
    
        gcc -I/usr/src/postgresql-6.3.2/src/include
           -I/usr/src/postgresql-6.3.2/src/backend                        
           -Wall -Wmissing-prototypes
           -fpic -I/usr/src/postgresql-6.3.2/src/include 
           -c cascade.c -o cascade.o
    
    but when I call de .o file from the function attached to the trigger , I
    get the next message:
    
    
        ERROR:  Load of file /SAP/SQL/funcs/spi/cascade.o failed:
                /SAP/SQL/funcs/spi/cascade.o: ELF file's phentsize not the
                expected size
    
    What can I do ???
    
    _______________________________________
    David Martinez Cuevas
    Direccion General de Estadistica, UNAM - Mexico
    Tel. 622-60-80
    E-mail david@estadistica.unam.mx
    ----------------------------------------
    
    
    
    
    
    
    
    
  4. RE: [SQL] Having problems to compile SPI

    Taral <taral@mail.utexas.edu> — 1998-08-25T18:26:30Z

    Aren't you supposed to link SPI functions as shared libraries?
    
    Try: gcc -shared -o cascade.so cascade.o
    
    Taral
    
    > -----Original Message-----
    > From: owner-pgsql-sql@hub.org [mailto:owner-pgsql-sql@hub.org]On Behalf
    > Of Jose David Martinez Cuevas
    > Sent: Tuesday, August 25, 1998 1:07 PM
    > To: pgsql-sql@postgreSQL.org
    > Subject: [SQL] Having problems to compile SPI
    > 
    > 
    > 
    > Hi.
    > 
    > I hope this is not a too much trivial question.
    > 
    > I'm having problems when compiling a new SPI function. I've been doing it
    > with :
    > 
    >     gcc -I/usr/src/postgresql-6.3.2/src/include
    >        -I/usr/src/postgresql-6.3.2/src/backend                        
    >        -Wall -Wmissing-prototypes
    >        -fpic -I/usr/src/postgresql-6.3.2/src/include 
    >        -c cascade.c -o cascade.o
    > 
    > but when I call de .o file from the function attached to the trigger , I
    > get the next message:
    > 
    > 
    >     ERROR:  Load of file /SAP/SQL/funcs/spi/cascade.o failed:
    >             /SAP/SQL/funcs/spi/cascade.o: ELF file's phentsize not the
    >             expected size
    > 
    > What can I do ???
    > 
    > _______________________________________
    > David Martinez Cuevas
    > Direccion General de Estadistica, UNAM - Mexico
    > Tel. 622-60-80
    > E-mail david@estadistica.unam.mx
    > ----------------------------------------
    > 
    > 
    > 
    > 
    > 
    > 
    >