Re: plpgsql question

From: Joe Conway <mail(at)joeconway(dot)com>
To: Jennifer Lee <jlee(at)scri(dot)sari(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql question
Date: 2003-11-04 05:40:45
Message-ID: 3FA73BDD.1090009@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jennifer Lee wrote:
> something like
>
> Parent1*Parent2
> or
> (grandparent1*grandparent2)*(grandparent3*grandparent4)
> or something even more complex
>
> The field is called ancest in table passport_temp.
>
> I need to separate each of the parents and/or grandparents etc to load
> them individually in a pedigree table. I'm trying to do this in plpgsql,
> but haven't been able to figure out if there is a way to parse the
> field.

You haven't been very specific, so it's hard to offer concrete advice.
But in any case, take a look at split_part() and replace() functions
(and possibly others) here:

http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=functions-string.html

HTH,

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-11-04 05:59:05 Re: How to use dblink within pl/pgsql function:
Previous Message Joe Conway 2003-11-04 02:11:05 Re: transposed query?