Обсуждение: Postgres DB recompilation

Поиск
Список
Период
Сортировка

Postgres DB recompilation

От
WeNotStupid
Дата:
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




Re: Postgres DB recompilation

От
Doug McNaught
Дата:
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

Re: Postgres DB recompilation

От
Martijn van Oosterhout
Дата:
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.

Re: Postgres DB recompilation

От
Tycho Fruru
Дата:
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

Вложения

Re: Postgres DB recompilation

От
David A Dickson
Дата:
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


Regualer expressions

От
David A Dickson
Дата:
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?




Re: Regualer expressions

От
Darren Ferguson
Дата:
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
>