Thread

  1. date_part function

    John Burski <john.burski@911ep.com> — 2000-12-29T15:36:07Z

    I was putzing around with the date/time functions to get a feel for how
    they work, when I ran across this bit of puzzling behavior.  I'm running
    PostgreSQL 7.0.3 on a Red Hat 6.1 box.
    
    I submitted the following query:
    
         select date_part('dow', timestamp 'now');
    
    and received the following results:
    
         ERROR:  Function 'date_part(text, timestamp)' does not exist
          Unable to identify a function which satisfies the given
         argument types
          You will have to retype your query using explicit typecasts
    
    However, the user documentation seems to indicate that this function is
    an integral part of PostgreSQL.
    
    What gives?
    
    Regards,
    
    --
    John Burski
    Chief IT Cook and Bottlewasher
    911 Emergency Products, St. Cloud, MN
    (320) 656 0076
    
    ++++++++++++++++++++++++++++++++++
    + How's your cheese holding out? +
    ++++++++++++++++++++++++++++++++++
    
    
    
    
    
  2. Re: date_part function

    D. Duccini <duccini@backpack.com> — 2000-12-29T15:50:36Z

    try this
    
    duccini=> select date_part('dow', 'now'::date);
    date_part
    ---------
            5
    (1 row)
    
    -duck
    
    
    On Fri, 29 Dec 2000, John Burski wrote:
    
    > I was putzing around with the date/time functions to get a feel for how
    > they work, when I ran across this bit of puzzling behavior.  I'm running
    > PostgreSQL 7.0.3 on a Red Hat 6.1 box.
    > 
    > I submitted the following query:
    > 
    >      select date_part('dow', timestamp 'now');
    > 
    > and received the following results:
    > 
    >      ERROR:  Function 'date_part(text, timestamp)' does not exist
    >       Unable to identify a function which satisfies the given
    >      argument types
    >       You will have to retype your query using explicit typecasts
    > 
    > However, the user documentation seems to indicate that this function is
    > an integral part of PostgreSQL.
    > 
    > What gives?
    > 
    > Regards,
    > 
    > --
    > John Burski
    > Chief IT Cook and Bottlewasher
    > 911 Emergency Products, St. Cloud, MN
    > (320) 656 0076
    > 
    > ++++++++++++++++++++++++++++++++++
    > + How's your cheese holding out? +
    > ++++++++++++++++++++++++++++++++++
    > 
    > 
    > 
    
    
    -----------------------------------------------------------------------------
    david@backpack.com            BackPack Software, Inc.        www.backpack.com
    +1 651.645.7550 voice       "Life is an Adventure.    
    +1 651.645.9798 fax            Don't forget your BackPack!"   
    -----------------------------------------------------------------------------
    
    
    
  3. Re: date_part function

    John Burski <john.burski@911ep.com> — 2000-12-29T16:12:05Z

    Just the ticket!
    
    Thanks!
    
    "D. Duccini" wrote:
    
    > try this
    >
    > duccini=> select date_part('dow', 'now'::date);
    > date_part
    > ---------
    >         5
    > (1 row)
    >
    > -duck
    >
    > On Fri, 29 Dec 2000, John Burski wrote:
    >
    > > I was putzing around with the date/time functions to get a feel for how
    > > they work, when I ran across this bit of puzzling behavior.  I'm running
    > > PostgreSQL 7.0.3 on a Red Hat 6.1 box.
    > >
    > > I submitted the following query:
    > >
    > >      select date_part('dow', timestamp 'now');
    > >
    > > and received the following results:
    > >
    > >      ERROR:  Function 'date_part(text, timestamp)' does not exist
    > >       Unable to identify a function which satisfies the given
    > >      argument types
    > >       You will have to retype your query using explicit typecasts
    > >
    > > However, the user documentation seems to indicate that this function is
    > > an integral part of PostgreSQL.
    > >
    > > What gives?
    > >
    > > Regards,
    > >
    > > --
    > > John Burski
    > > Chief IT Cook and Bottlewasher
    > > 911 Emergency Products, St. Cloud, MN
    > > (320) 656 0076
    > >
    > > ++++++++++++++++++++++++++++++++++
    > > + How's your cheese holding out? +
    > > ++++++++++++++++++++++++++++++++++
    > >
    > >
    > >
    >
    > -----------------------------------------------------------------------------
    > david@backpack.com            BackPack Software, Inc.        www.backpack.com
    > +1 651.645.7550 voice       "Life is an Adventure.
    > +1 651.645.9798 fax            Don't forget your BackPack!"
    > -----------------------------------------------------------------------------
    
    --
    John Burski
    Chief IT Cook and Bottlewasher
    911 Emergency Products, St. Cloud, MN
    (320) 656 0076
    
    ++++++++++++++++++++++++++++++++++
    + How's your cheese holding out? +
    ++++++++++++++++++++++++++++++++++
    
    
    
    
    
  4. Re: date_part function

    Tom Lane <tgl@sss.pgh.pa.us> — 2000-12-29T20:53:38Z

    John Burski <John.Burski@911ep.com> writes:
    > I submitted the following query:
    >      select date_part('dow', timestamp 'now');
    > and received the following results:
    >      ERROR:  Function 'date_part(text, timestamp)' does not exist
    >       Unable to identify a function which satisfies the given
    >      argument types
    >       You will have to retype your query using explicit typecasts
    
    Odd.  It works fine for me.  What do you get from psql's "\df date_part"?
    
    			regards, tom lane
    
    
  5. Re: date_part function

    John Burski <john.burski@911ep.com> — 2000-12-29T21:56:58Z

    My bad!!
    
    I was reading the docs for 7.0.3 (which I've installed on my workstation)
    and ssh'd across to a different box using an older version (6.5.2).  Too
    many xterms running at the same time.  Sheesh!  I need a vacation!
    
    Tom Lane wrote:
    
    > John Burski <John.Burski@911ep.com> writes:
    > > I submitted the following query:
    > >      select date_part('dow', timestamp 'now');
    > > and received the following results:
    > >      ERROR:  Function 'date_part(text, timestamp)' does not exist
    > >       Unable to identify a function which satisfies the given
    > >      argument types
    > >       You will have to retype your query using explicit typecasts
    >
    > Odd.  It works fine for me.  What do you get from psql's "\df date_part"?
    >
    >                         regards, tom lane
    
    --
    John Burski
    Chief IT Cook and Bottlewasher
    911 Emergency Products, St. Cloud, MN
    (320) 656 0076       www.911ep.com
    
    ++++++++++++++++++++++++++++++++++
    + How's your cheese holding out? +
    ++++++++++++++++++++++++++++++++++
    
    
    
    
    
  6. Re: date_part function

    Charles Curley <ccurley@trib.com> — 2000-12-30T00:13:14Z

    On Fri, Dec 29, 2000 at 03:56:58PM -0600, John Burski wrote:
    > My bad!!
    > 
    > I was reading the docs for 7.0.3 (which I've installed on my workstation)
    > and ssh'd across to a different box using an older version (6.5.2).  Too
    > many xterms running at the same time.  Sheesh!  I need a vacation!
    
    You may need a vacation, but you also need to set your shell prompt up to
    set the xterm's title bar to indicate the host and working directory. For
    bash:
    
    
    # Show path in xterm title bar. Originally from Russel & Crawford, "Unix &
    # Linux Answers", Osborne, 1998
    
    if [ "$TERM" = xterm ]; then
      PS1='\u@\h \$ \[\033]0;xterm \h:\w\007\]'
    else
      PS1='\u@\h \w \\$ '
    fi
    
    
    
    -- 
    
    		-- C^2
    
    No windows were crashed in the making of this email.
    
    Looking for fine software and/or web pages?
    http://w3.trib.com/~ccurley