pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Henry Ortega <juandelacruz@gmail.com>
To: Owen Jacobson <ojacobson@osl.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Given 02-01-2006 to 02-28-2006, output all days.
Date: Sun, 19 Feb 2006 13:47:21 -0500
Message-ID: <2bffcc330602191047w6338e67aw77145989046f93d6@mail.gmail.com> (raw)
In-Reply-To: <144D12D7DD4EC04F99241498BB4EEDCC220D78@nelson.osl.com>
References: <144D12D7DD4EC04F99241498BB4EEDCC220D78@nelson.osl.com>

I was able to find a suitable 7.3.2 plpgsql.so and now plpgsql works.
(supposedly)

I am trying out some really basic function creation such as this:

create function dng2(start_date DATE) returns setof date as $$
declare
aa date:=start_date;

But I always get this
ERROR:  parser: parse error at or near "DATE" at character 33
before I can even finish.

Any idea why this happens?




On 2/17/06, Owen Jacobson <ojacobson@osl.com> wrote:
>
> That usually indicates that, for whatever reason, plpgsql.so is from a
> different version of PostgreSQL than the database server.  If you installed
> PostgreSQL from source, make sure you configured the server to look in the
> same lib dir as its libs were installed to; if you've installed from package
> management of some kind (RPM?) make sure you have the same versions of all
> postgres-related packages.
>
> You should also upgrade, if possible.  7.3 is effectively obsolete (37
> releases old); there are a number of bugfixes and performance improvements
> in more recent versions.
>
> -Owen
>
> -----Original Message-----
> From: Henry Ortega [mailto:juandelacruz@gmail.com]
> Sent: Friday, February 17, 2006 2:06 PM
> To: Owen Jacobson
> Subject: Re: [SQL] Given 02-01-2006 to 02-28-2006, output all days.
>
>
> This sounds good. I don't have plpgsql loaded though.
>
> I am trying to load plpgsql and it's giving me:
> ERROR:  Load of file /usr/lib/pgsql/plpgsql.so failed:
> /usr/lib/pgsql/plpgsql.so: undefined symbol: xlateSqlType
> createlang: language installation failed
>
> I have pgsql 7.3.2
> I am googling and can't seem to find the answer. Any help would be
> appreciated.
>
>
> On 2/17/06, Owen Jacobson <ojacobson@osl.com> wrote:
> Henry Ortega wrote:
>
> (question about set of all days between two dates)
>
> I don't know of a builtin way to do it off the top of my head, but it's a
> pretty simple function to write:
>
> create function days (start date, finish date) returns setof date as $$
> declare
>   curdate date;
> begin
>   curdate := start;
>   while (curdate <= finish) loop
>     return next curdate;
>     curdate := curdate + 1;
>   end loop;
>   return;
> end;
> $$ language plpgsql;
>
> # select * from days ('2006-02-01', '2006-02-07');
>     days
> ------------
> 2006-02-01
> 2006-02-02
> 2006-02-03
> 2006-02-04
> 2006-02-05
> 2006-02-06
> 2006-02-07
> (7 rows)
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

view thread (9+ messages)  latest in thread

Message-ID: <2bffcc330602191047w6338e67aw77145989046f93d6@mail.gmail.com>
Permalink:  ../2bffcc330602191047w6338e67aw77145989046f93d6@mail.gmail.com/
Also on:    postgresql.org/message-id/2bffcc330602191047w6338e67aw77145989046f93d6@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: juandelacruz@gmail.com, ojacobson@osl.com
  Subject: Re: Given 02-01-2006 to 02-28-2006, output all days.
  In-Reply-To: <2bffcc330602191047w6338e67aw77145989046f93d6@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox