Thread

  1. Postgres DB recompilation

    WeNotStupid <wenotstupid@notstupid.com> — 2002-06-17T02:03:52Z

    Hi,
    
    From some 7.0.2 literature,  it was said that one need to perform  a
    Postgres Database recompilation  in order to have
    greater than 8KB image files/objects (object data type) to be stored in
    Postgres. Has anyone done this before ?
    Would you be happy to share this knowledge ?
    
    regards
    James
    
    
    
    
    
  2. Re: Postgres DB recompilation

    Doug McNaught <doug@wireboard.com> — 2002-06-17T13:37:16Z

    WeNotStupid <WeNotStupid@NotStupid.com> writes:
    
    > Hi,
    > 
    > >From some 7.0.2 literature,  it was said that one need to perform  a
    > Postgres Database recompilation  in order to have
    > greater than 8KB image files/objects (object data type) to be stored in
    > Postgres. Has anyone done this before ?
    > Would you be happy to share this knowledge ?
    
    Modern versions (7.1 and up) do not have this limit.
    
    -Doug
    
    
  3. Re: Postgres DB recompilation

    tycho@fruru.com — 2002-06-17T13:39:35Z

    On Mon, 2002-06-17 at 04:03, WeNotStupid wrote:
    > Hi,
    > 
    > >From some 7.0.2 literature,  it was said that one need to perform  a
    > Postgres Database recompilation  in order to have
    > greater than 8KB image files/objects (object data type) to be stored in
    > Postgres. Has anyone done this before ?
    > Would you be happy to share this knowledge ?
    
    Why don't you just use 7.2, which handles these larger datatypes just
    fine ?
    
    Cheers,
    Tycho
    
    -- 
    Tycho Fruru			                tycho@fruru.com
    "Prediction is extremely difficult. Especially about the future."
      - Niels Bohr
    
  4. Re: Postgres DB recompilation

    Martijn van Oosterhout <kleptog@svana.org> — 2002-06-17T13:41:24Z

    On Mon, Jun 17, 2002 at 10:03:52AM +0800, WeNotStupid wrote:
    > Hi,
    > 
    > >From some 7.0.2 literature,  it was said that one need to perform  a
    > Postgres Database recompilation  in order to have
    > greater than 8KB image files/objects (object data type) to be stored in
    > Postgres. Has anyone done this before ?
    > Would you be happy to share this knowledge ?
    
    If you upgrade to 7.2, then any field can hold practiacally unlimited data.
    
    Prior to that, lerge things could only be stored within blobs.
    -- 
    Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
    > There are 10 kinds of people in the world, those that can do binary
    > arithmetic and those that can't.
    
    
  5. Re: Postgres DB recompilation

    David A Dickson <davidd@saraswati.wcg.mcgill.ca> — 2002-06-17T16:04:55Z

    I am trying to do an update using regular expressions. Is something
    like this possible?
    
    a=# select path from page where path ~ '/academic-staff/reports/(.*$)';
                    path
    --------------------------------------
     /academic-staff/reports/agriculture/
     /academic-staff/reports/arts/
     /academic-staff/reports/education/
     /academic-staff/reports/engineering/
     /academic-staff/reports/medicine/
     /academic-staff/reports/music/
     /academic-staff/reports/science/
     /academic-staff/reports/
    
    a=# update page set path = '/academic-staff/fooreports/\1'
    where path ~ '/academic-staff/reports/(.*$)';
    
    
    What I'm trying to do is replace all occurances of
    /academic-staff/reports/(.*$) with
    /academic-staff/fooreports/\1
    where \1 is everything that was matched by the .*$
    
    can it be done? anyone know how?
    
    -- 
    David A Dickson
    david.dickson@mail.mcgill.ca
    
    
    
  6. Regualer expressions

    David A Dickson <davidd@saraswati.wcg.mcgill.ca> — 2002-06-17T18:34:20Z

    Sorry, messed up the subject.
    
    On Mon, 17 Jun 2002, David A Dickson wrote:
    
    I am trying to do an update using regular expressions. Is something
    like this possible?
    
    a=# select path from page where path ~ '/academic-staff/reports/(.*$)';
                    path
     --------------------------------------
     /academic-staff/reports/agriculture/
     /academic-staff/reports/arts/
     /academic-staff/reports/education/
     /academic-staff/reports/engineering/
     /academic-staff/reports/medicine/
     /academic-staff/reports/music/
     /academic-staff/reports/science/
     /academic-staff/reports/
    
    a=# update page set path = '/academic-staff/fooreports/\1'
    where path ~ '/academic-staff/reports/(.*$)';
    
    
    What I'm trying to do is replace all occurances of
    /academic-staff/reports/(.*$) with
    /academic-staff/fooreports/\1
    where \1 is everything that was matched by the .*$
    
    can it be done? anyone know how?
    
    
    
    
    
  7. Re: Regualer expressions

    Darren Ferguson <darren@crystalballinc.com> — 2002-06-17T19:47:52Z

    It can be done but i don't think you can do it pure SQL unless you want to
    start using substr and all that.
    
    You can useone of the built in languages such as pltcl or plperl.
    
    These will help you achieve what you want.
    
    Quick pltcl one
    
    CREATE OR REPLACE FUNCTION sp_reports() RETURNS BOOLEAN AS '
      spi_exec -array C "SELECT path FROM page WHERE path LIKE
    ''/academic-staff/reports/%''" {
         foreach element [split $C(path) "/"] {
           if { $element == "reports" } {
              set element "fooreports"
           }
           append newpath "$element/"
         }
         lappend newpath_list [list "$C(path)" "$newpath"]
      }
      foreach element $newpath_list {
        foreach { oldpath newpath } $element {}
        spi_exec "UPDATE page SET path = ''$newpath'' WHERE path =
    ''$oldpath''"
      }
      RETURN 1
    ' LANGUAGE 'pltcl';
    
    This is just a quick and dirty way to do it and i haven't even tested it
    but it should work fine
    
    HTH
    
    Darren Ferguson
    
    On Mon, 17 Jun 2002, David A Dickson wrote:
    
    > Sorry, messed up the subject.
    > 
    > On Mon, 17 Jun 2002, David A Dickson wrote:
    > 
    > I am trying to do an update using regular expressions. Is something
    > like this possible?
    > 
    > a=# select path from page where path ~ '/academic-staff/reports/(.*$)';
    >                 path
    >  --------------------------------------
    >  /academic-staff/reports/agriculture/
    >  /academic-staff/reports/arts/
    >  /academic-staff/reports/education/
    >  /academic-staff/reports/engineering/
    >  /academic-staff/reports/medicine/
    >  /academic-staff/reports/music/
    >  /academic-staff/reports/science/
    >  /academic-staff/reports/
    > 
    > a=# update page set path = '/academic-staff/fooreports/\1'
    > where path ~ '/academic-staff/reports/(.*$)';
    > 
    > 
    > What I'm trying to do is replace all occurances of
    > /academic-staff/reports/(.*$) with
    > /academic-staff/fooreports/\1
    > where \1 is everything that was matched by the .*$
    > 
    > can it be done? anyone know how?
    > 
    > 
    > 
    > 
    > ---------------------------(end of broadcast)---------------------------
    > TIP 3: if posting/reading through Usenet, please send an appropriate
    > subscribe-nomail command to majordomo@postgresql.org so that your
    > message can get through to the mailing list cleanly
    >