Thursday, July 17, 2008

Re: [GENERAL] TODO list and "hyphen"

Scara Maccai wrote:
> Hi,
>
> I was looking at the TODO:
>
> http://www.postgresql.org/docs/faqs.TODO.html
>
>
> "A hyphen, "-", marks changes that will appear in the upcoming 8.4 release."
>
> Well, making a search for the "-" sign is complicated... it's obviously
> used for a lot of other things... could you use another character?

I think a search for ' -' will show you the items you want.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] TODO list and "hyphen"

salman wrote:
> >> -Allow administrators to safely terminate individual sessions either
> via an SQL function or SIGTERM <<
>
> Can't you already do this with pg_cancel_backend() or kill <child pid>?

Cancel backend only cancels the current query but later queries are
still executed. Kill was never officially supported as a way to
terminate a backend, but it will be in 8.4 and there is an SQL function
to do it too.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[HACKERS] Re: [COMMITTERS] pgsql: Add column storage type to psql \d+ display.

Alvaro Herrera wrote:
> Bruce Momjian wrote:
> > Log Message:
> > -----------
> > Add column storage type to psql \d+ display.
>
> I think this patch has caused this new warning in psql:
>
> /pgsql//source/00head/src/bin/psql/describe.c: In function ?describeOneTableDetails?:
> /pgsql//source/00head/src/bin/psql/describe.c:832: warning: ?tableinfo.relkind? may be used uninitialized in this function

I don't see that warning with my compiler so I have no way of testing
this, but I do see this line pretty high in the function:

tableinfo.relkind = *(PQgetvalue(res, 0, 1));

Do you have any idea how relkind could be accessed before this
assignment? The line number is it complaining about is the definition
of relkind in the structure, not any reference to the variable.

The only crazy idea I have is that the variable name appears in a string
above the assignment:

"SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules, "

And relkind is the only column that matches a structure member.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [pdxpug] PDX PostgreSQL Meeting

On Wed, Jul 16, 2008 at 5:42 PM, Tim Bruce <timsnews@tbruce.com> wrote:
> After talking (ahhm, e-mailing) with Selena, we won't be having our normal
> meeting tomorow (Thursday, July 17th). The Sunday get-together (listed on
> the pdxpug web site - http://pugs.postgresql.org/pdx) will replace it.
>
> So don't go to Free Geek tomorrow looking for us!

D'oh! I didn't see this until now. Too much email yesterday.

--
Sent via pdxpug mailing list (pdxpug@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pdxpug

Re: [COMMITTERS] pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.

Simon Riggs wrote:
> > Huh? There was a bug report, with suggested fix on June 5th from
> > Nikhil - http://archives.postgresql.org/pgsql-hackers/2008-06/msg00231.php
> >
> > No-one responded, and over a month later Bruce fixed the bug, pointing
> > out that TRUNCATE is now consistent with LOCK.
> >
> > The fact that Bruce fixed it during a commit fest is irrelevant. Bug
> > fixes don't stop for commit fests
>
> OK, my mistake. Comments withdrawn, with apologies.

The ugly truth is that my schedule is now so crazy with travel that I am
having to catch up with community emails that need attention anytime I
have the chance, rather than at appropriate times.

Recent schedule:

-1 week, church mission trip to Pittsburgh
+1 week, OSCON
+3 weeks, Linuxworld
+6 weeks, Brasilia conference

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

[COMMITTERS] pgsql: Add URL for: * Implement SQL:2003 window functions >

Log Message:
-----------
Add URL for:

* Implement SQL:2003 window functions

> http://archives.postgresql.org/pgsql-hackers/2008-07/msg00232.php

Modified Files:
--------------
pgsql/doc:
TODO (r1.2491 -> r1.2492)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/TODO?r1=1.2491&r2=1.2492)
pgsql/doc/src/FAQ:
TODO.html (r1.997 -> r1.998)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/FAQ/TODO.html?r1=1.997&r2=1.998)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Re: [pgsql-advocacy] PostgreSQL passes MySQL for Freshmeat Downloads

Marc G. Fournier wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Josh was added as Admin a few weeks ago ... which you would know if you had
> taken to actually check the entry :)

Oh, I see it now. Sorry. :-(

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-advocacy mailing list (pgsql-advocacy@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-advocacy

[NOVICE] tracking down idle transactions in pg_locks

I've been tracking down a problem with idle transactions being left open
and not being able to vacuum one of my tables. I think I have tracked it
down to proprietary app, the problem seems to be that it leaves "idle
transactions" open.

However the table that we are having problems vacuuming (probably just
because it is the most active table) is in the same db, but a different
scheme not accessed by that app. Could this app still be causing the
problem?

I did a select on the pg_locks table and filtered by the pid of the idle
transaction. There were 8 locks, 7 were on tables that the app uses
however the 8th was of locktype=virtualxid and mode=ExclusiveLock. Could
this be some sort of global lock?

I have been able to verify that closing the app, does allow us to vacuum
the table.

--
David Gardner


--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [PATCHES] WITH RECUSIVE patches 0717

> > Here is the lastest WITH RECURSIVE patches against CVS HEAD created by
> > Yoshiyuki Asaba and minor corrections by Tatsuo Ishii.
>
> I tried this patch vs. CVS HEAD used my usual configure option with
> only --with-prefix set, then tried to make, and got:
>
> make[3]: *** No rule to make target `parse_cte.o', needed by `objfiles.txt'. Stop.
> make[3]: Leaving directory `/home/shackle/pgsql/src/backend/parser'
> make[2]: *** [parser-recursive] Error 2
> make[2]: Leaving directory `/home/shackle/pgsql/src/backend'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/shackle/pgsql/src'
> make: *** [all] Error 2
>
> Is there something missing?

Oops. I forgot to include patches against newly added files. Please
try included patches.

> > (David Fetter's psql help patches are not included. It seems his git
> > repository has gone).
>
> I apologize for that. I rearranged it last night because the name was
> not scalable, but delayed sending this out until today. It can now be
> found at
>
> <http://git.postgresql.org/?p=~davidfetter/with_recursive/.git;a=summary>
>
> To pull from the new location, in your .git/config, change URL from something
> like the following:
>
> url = git://davidfetter@git.postgresql.org/git/~davidfetter/postgresql/.git
>
> to
>
> url = git://davidfetter@git.postgresql.org/git/~davidfetter/with_recursive/.git

Let me try later.

> > This version implements:
> >
> > - detect certain queries those are not valid acroding to the standard
>
> Great :)
>
> > I also include erroneous query examples created by Yoshiyuki (probably
> > will become part of regression tests).
> >
> > Remaining problmes are:
> >
> > 1) sort query names acording to the dependency
>
> This can be done at query time already using arrays per Asaba-san's
> suggestion. I'll add some examples to the documentation.

1) refers to mutually recursive queres.

> > 2) planner always estimate 0 cost for recursion plans
> > 3) add regression tests
> >
> > For 1), I have proposed we limit query names to 1, in another word do
> > not allow mutually recursive queries. For 2) there's no good idea to
> > solve it, so I suggest leave it as it is now.
> >
> > For 3) I will generate regression tests as soon as possible.
> >
> > So the patches seem to be almost ready to commit IMO.
>
> Wonderful!
>
> Cheers,
> David.
> --
> David Fetter <david@fetter.org> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: david.fetter@gmail.com
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate

[GENERAL] Reducing memory usage of insert into select operations?

Redhat 4
postgresql 8.3.3
Memory: 12GB

While doing a couple of operations of the type
insert into <table> select from <some other table>

The OS triggered the out of memory killer (oom-killer).

After some research and trial/error I found it was the inserts.
I see one of the inserts is using up 12GB!

How can I reduce the usage?
Postgresql.conf settings.
shared_buffers = 3GB
temp_buffers = 64MB # min 800kB
work_mem = 256MB # min 64kB
maintenance_work_mem = 1GB

Reducing work_mem would help?

The table I am selecting from has a few hundred million rows.
The table I am inserting into has partitions. I am benchmarking breaking up
a large table into smaller partitions.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [HACKERS] [GENERAL] Fragments in tsearch2 headline

Index: src/backend/tsearch/wparser_def.c
===================================================================
RCS file: /home/postgres/devel/pgsql-cvs/pgsql/src/backend/tsearch/wparser_def.c,v
retrieving revision 1.15
diff -c -r1.15 wparser_def.c
*** src/backend/tsearch/wparser_def.c 17 Jun 2008 16:09:06 -0000 1.15
--- src/backend/tsearch/wparser_def.c 18 Jul 2008 00:07:22 -0000
***************
*** 1684,1701 ****
return false;
}

! Datum
! prsd_headline(PG_FUNCTION_ARGS)
{
! HeadlineParsedText *prs = (HeadlineParsedText *) PG_GETARG_POINTER(0);
! List *prsoptions = (List *) PG_GETARG_POINTER(1);
! TSQuery query = PG_GETARG_TSQUERY(2);

! /* from opt + start and and tag */
! int min_words = 15;
! int max_words = 35;
! int shortword = 3;

int p = 0,
q = 0;
int bestb = -1,
--- 1684,1941 ----
return false;
}

! static void
! mark_fragment(HeadlineParsedText *prs, int highlight, int startpos, int endpos)
{
! int i;
! char *coversep = "... ";
! int seplen = strlen(coversep);

! for (i = startpos; i <= endpos; i++)
! {
! if (prs->words[i].item)
! prs->words[i].selected = 1;
! if (highlight == 0)
! {
! if (HLIDIGNORE(prs->words[i].type))
! prs->words[i].replace = 1;
! }
! else
! {
! if (XMLHLIDIGNORE(prs->words[i].type))
! prs->words[i].replace = 1;
! }
!
! prs->words[i].in = (prs->words[i].repeated) ? 0 : 1;
! }
! /* add cover separators if needed */
! if (startpos > 0 && startpos <= endpos)
! {
!
! prs->words[startpos-1].word = repalloc(prs->words[startpos-1].word, sizeof(char) * seplen);
! prs->words[startpos-1].in = 1;
! prs->words[startpos-1].len = seplen;
! memcpy(prs->words[startpos-1].word, coversep, seplen);
! }
! }
!
! typedef struct
! {
! int4 startpos;
! int4 endpos;
! int4 poslen;
! int4 curlen;
! int2 in;
! int2 excluded;
! } CoverPos;
!
! static void
! get_next_fragment(HeadlineParsedText *prs, int *startpos, int *endpos,
! int *curlen, int *poslen, int max_words)
! {
! int i;
! /* Objective: Generate a fragment of words between startpos and endpos
! * such that it has at most max_words and both ends has query words.
! * If the startpos and endpos are the endpoints of the cover and the
! * cover has fewer words than max_words, then this function should
! * just return the cover
! */
! /* first move startpos to an item */
! for(i = *startpos; i <= *endpos; i++)
! {
! *startpos = i;
! if (prs->words[i].item && !prs->words[i].repeated)
! break;
! }
! /* cut endpos to have only max_words */
! *curlen = 0;
! *poslen = 0;
! for(i = *startpos; i <= *endpos && *curlen < max_words; i++)
! {
! if (!NONWORDTOKEN(prs->words[i].type))
! *curlen += 1;
! if (prs->words[i].item && !prs->words[i].repeated)
! *poslen += 1;
! }
! /* if the cover was cut then move back endpos to a query item */
! if (*endpos > i)
! {
! *endpos = i;
! for(i = *endpos; i >= *startpos; i --)
! {
! *endpos = i;
! if (prs->words[i].item && !prs->words[i].repeated)
! break;
! if (!NONWORDTOKEN(prs->words[i].type))
! *curlen -= 1;
! }
! }
! }
!
! static void
! mark_hl_fragments(HeadlineParsedText *prs, TSQuery query, int highlight,
! int shortword, int min_words,
! int max_words, int max_fragments)
! {
! int4 poslen, curlen, i, f, num_f = 0;
! int4 stretch, maxstretch, posmarker;
!
! int4 startpos = 0,
! endpos = 0,
! p = 0,
! q = 0;
!
! int4 numcovers = 0,
! maxcovers = 32;
!
! int4 minI, minwords, maxitems;
! CoverPos *covers;
!
! covers = palloc(maxcovers * sizeof(CoverPos));
!
! /* get all covers */
! while (hlCover(prs, query, &p, &q))
! {
! startpos = p;
! endpos = q;
!
! /* Break the cover into smaller fragments such that each fragment
! * has at most max_words. Also ensure that each end of the fragment
! * is a query word. This will allow us to stretch the fragment in
! * either direction
! */
!
! while (startpos <= endpos)
! {
! get_next_fragment(prs, &startpos, &endpos, &curlen, &poslen, max_words);
! if (numcovers >= maxcovers)
! {
! maxcovers *= 2;
! covers = repalloc(covers, sizeof(CoverPos) * maxcovers);
! }
! covers[numcovers].startpos = startpos;
! covers[numcovers].endpos = endpos;
! covers[numcovers].curlen = curlen;
! covers[numcovers].poslen = poslen;
! covers[numcovers].in = 0;
! covers[numcovers].excluded = 0;
! numcovers ++;
! startpos = endpos + 1;
! endpos = q;
! }
! /* move p to generate the next cover */
! p++;
! }

+ /* choose best covers */
+ for (f = 0; f < max_fragments; f++)
+ {
+ maxitems = 0;
+ minwords = 0x7fffffff;
+ minI = -1;
+ /* Choose the cover that contains max items.
+ * In case of tie choose the one with smaller
+ * number of words.
+ */
+ for (i = 0; i < numcovers; i ++)
+ {
+ if (!covers[i].in && !covers[i].excluded &&
+ (maxitems < covers[i].poslen || (maxitems == covers[i].poslen
+ && minwords > covers[i].curlen)))
+ {
+ maxitems = covers[i].poslen;
+ minwords = covers[i].curlen;
+ minI = i;
+ }
+ }
+ /* if a cover was found mark it */
+ if (minI >= 0)
+ {
+ covers[minI].in = 1;
+ /* adjust the size of cover */
+ startpos = covers[minI].startpos;
+ endpos = covers[minI].endpos;
+ curlen = covers[minI].curlen;
+ /* stretch the cover if cover size is lower than max_words */
+ if (curlen < max_words)
+ {
+ /* divide the stretch on both sides of cover */
+ maxstretch = (max_words - curlen)/2;
+ /* first stretch the startpos
+ * stop stretching if
+ * 1. we hit the beginning of document
+ * 2. exceed maxstretch
+ * 3. we hit an already marked fragment
+ */
+ stretch = 0;
+ posmarker = startpos;
+ for (i = startpos - 1; i >= 0 && stretch < maxstretch && !prs->words[i].in; i--)
+ {
+ if (!NONWORDTOKEN(prs->words[i].type))
+ {
+ curlen ++;
+ stretch ++;
+ }
+ posmarker = i;
+ }
+ /* cut back startpos till we find a non short token */
+ for (i = posmarker; i < startpos && (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword); i++)
+ {
+ if (!NONWORDTOKEN(prs->words[i].type))
+ curlen --;
+ }
+ startpos = i;
+ /* now stretch the endpos as much as possible*/
+ posmarker = endpos;
+ for (i = endpos + 1; i < prs->curwords && curlen < max_words && !prs->words[i].in; i++)
+ {
+ if (!NONWORDTOKEN(prs->words[i].type))
+ curlen ++;
+ posmarker = i;
+ }
+ /* cut back endpos till we find a non-short token */
+ for ( i = posmarker; i > endpos && (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword); i--)
+ {
+ if (!NONWORDTOKEN(prs->words[i].type))
+ curlen --;
+ }
+ endpos = i;
+ }
+ covers[minI].startpos = startpos;
+ covers[minI].endpos = endpos;
+ covers[minI].curlen = curlen;
+ /* Mark the chosen fragments (covers) */
+ mark_fragment(prs, highlight, startpos, endpos);
+ num_f ++;
+ /* exclude overlapping covers */
+ for (i = 0; i < numcovers; i ++)
+ {
+ if (i != minI && ( (covers[i].startpos >= covers[minI].startpos && covers[i].startpos <= covers[minI].endpos) || (covers[i].endpos >= covers[minI].startpos && covers[i].endpos <= covers[minI].endpos)))
+ covers[i].excluded = 1;
+ }
+ }
+ else
+ break;
+ }
+
+ /* show at least min_words we have not marked anything*/
+ if (num_f <= 0)
+ {
+ startpos = endpos = curlen = 0;
+ for (i = 0; i < prs->curwords && curlen < min_words; i++)
+ {
+ if (!NONWORDTOKEN(prs->words[i].type))
+ curlen++;
+ endpos = i;
+ }
+ mark_fragment(prs, highlight, startpos, endpos);
+ }
+ pfree(covers);
+ }
+ static void
+ mark_hl_words(HeadlineParsedText *prs, TSQuery query, int highlight,
+ int shortword, int min_words, int max_words)
+ {
int p = 0,
q = 0;
int bestb = -1,
***************
*** 1707,1762 ****
curlen;

int i;
- int highlight = 0;
- ListCell *l;
-
- /* config */
- prs->startsel = NULL;
- prs->stopsel = NULL;
- foreach(l, prsoptions)
- {
- DefElem *defel = (DefElem *) lfirst(l);
- char *val = defGetString(defel);
-
- if (pg_strcasecmp(defel->defname, "MaxWords") == 0)
- max_words = pg_atoi(val, sizeof(int32), 0);
- else if (pg_strcasecmp(defel->defname, "MinWords") == 0)
- min_words = pg_atoi(val, sizeof(int32), 0);
- else if (pg_strcasecmp(defel->defname, "ShortWord") == 0)
- shortword = pg_atoi(val, sizeof(int32), 0);
- else if (pg_strcasecmp(defel->defname, "StartSel") == 0)
- prs->startsel = pstrdup(val);
- else if (pg_strcasecmp(defel->defname, "StopSel") == 0)
- prs->stopsel = pstrdup(val);
- else if (pg_strcasecmp(defel->defname, "HighlightAll") == 0)
- highlight = (pg_strcasecmp(val, "1") == 0 ||
- pg_strcasecmp(val, "on") == 0 ||
- pg_strcasecmp(val, "true") == 0 ||
- pg_strcasecmp(val, "t") == 0 ||
- pg_strcasecmp(val, "y") == 0 ||
- pg_strcasecmp(val, "yes") == 0);
- else
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("unrecognized headline parameter: \"%s\"",
- defel->defname)));
- }

if (highlight == 0)
{
- if (min_words >= max_words)
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("MinWords should be less than MaxWords")));
- if (min_words <= 0)
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("MinWords should be positive")));
- if (shortword < 0)
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("ShortWord should be >= 0")));
-
while (hlCover(prs, query, &p, &q))
{
/* find cover len in words */
--- 1947,1955 ----
***************
*** 1877,1882 ****
--- 2070,2152 ----
prs->words[i].in = (prs->words[i].repeated) ? 0 : 1;
}

+ }
+
+ Datum
+ prsd_headline(PG_FUNCTION_ARGS)
+ {
+ HeadlineParsedText *prs = (HeadlineParsedText *) PG_GETARG_POINTER(0);
+ List *prsoptions = (List *) PG_GETARG_POINTER(1);
+ TSQuery query = PG_GETARG_TSQUERY(2);
+
+ /* from opt + start and and tag */
+ int min_words = 15;
+ int max_words = 35;
+ int shortword = 3;
+ int max_fragments = 0;
+ int highlight = 0;
+ ListCell *l;
+
+ /* config */
+ prs->startsel = NULL;
+ prs->stopsel = NULL;
+ foreach(l, prsoptions)
+ {
+ DefElem *defel = (DefElem *) lfirst(l);
+ char *val = defGetString(defel);
+
+ if (pg_strcasecmp(defel->defname, "MaxWords") == 0)
+ max_words = pg_atoi(val, sizeof(int32), 0);
+ else if (pg_strcasecmp(defel->defname, "MinWords") == 0)
+ min_words = pg_atoi(val, sizeof(int32), 0);
+ else if (pg_strcasecmp(defel->defname, "ShortWord") == 0)
+ shortword = pg_atoi(val, sizeof(int32), 0);
+ else if (pg_strcasecmp(defel->defname, "MaxFragments") == 0)
+ max_fragments = pg_atoi(val, sizeof(int32), 0);
+ else if (pg_strcasecmp(defel->defname, "StartSel") == 0)
+ prs->startsel = pstrdup(val);
+ else if (pg_strcasecmp(defel->defname, "StopSel") == 0)
+ prs->stopsel = pstrdup(val);
+ else if (pg_strcasecmp(defel->defname, "HighlightAll") == 0)
+ highlight = (pg_strcasecmp(val, "1") == 0 ||
+ pg_strcasecmp(val, "on") == 0 ||
+ pg_strcasecmp(val, "true") == 0 ||
+ pg_strcasecmp(val, "t") == 0 ||
+ pg_strcasecmp(val, "y") == 0 ||
+ pg_strcasecmp(val, "yes") == 0);
+ else
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("unrecognized headline parameter: \"%s\"",
+ defel->defname)));
+ }
+
+ if (highlight == 0)
+ {
+ if (min_words >= max_words)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("MinWords should be less than MaxWords")));
+ if (min_words <= 0)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("MinWords should be positive")));
+ if (shortword < 0)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("ShortWord should be >= 0")));
+ if (max_fragments < 0)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("MaxFragments should be >= 0")));
+ }
+
+ if (max_fragments == 0)
+ /* call the default headline generator */
+ mark_hl_words(prs, query, highlight, shortword, min_words, max_words);
+ else
+ mark_hl_fragments(prs, query, highlight, shortword, min_words, max_words, max_fragments);
+
if (!prs->startsel)
prs->startsel = pstrdup("<b>");
if (!prs->stopsel)
***************
*** 1886,1888 ****
--- 2156,2159 ----

PG_RETURN_POINTER(prs);
}
+
-- does it work

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy
query and optionally return them in some order. Most common case: Find
documents containing all query terms and return them in order of their
similarity to the query.', to_tsquery('english', 'documents'),
'MaxFragments=1');

ts_headline
----------------------------------------------------------------------
... purpose of FTS is to find <b>documents</b>, which satisfy query and
optionally return them in some order. Most common case: Find <b>documents</b>
containing all query terms and return them in order of their similarity
(1 row)

-- does it respect MinWords

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'nosuchterm'), 'MaxFragments=1,MinWords=5');
ts_headline
-----------------------
The purpose of FTS is


-- does it respect MaxWords

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'document'), 'MaxFragments=1,MinWords=5,MaxWords=8');
ts_headline
----------------------------------------------------------------------
... find <b>documents</b>, which satisfy query and optionally return

-- does it exclude ShortWord in the end ( "in" is excluded)

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'document'), 'MaxFragments=1,MinWords=5,MaxWords=10');
ts_headline
---------------------------------------------------------------------------
... find <b>documents</b>, which satisfy query and optionally return them


-- does it exclude ShortWord in the front ( "The" is excluded)

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'document'), 'MaxFragments=1,MinWords=5,MaxWords=13');
ts_headline
-------------------------------------------------------------------------------------------
... purpose of FTS is to find <b>documents</b>, which satisfy query and optionally return
(1 row)


-- when multiple words are used, the cover is shown in middle of the fragment (cover size <= MaxWords)

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'optional & order'), 'MaxFragments=1,MinWords=5,MaxWords=10');
ts_headline
-------------------------------------------------------------------------------
... query and <b>optionally</b> return them in some <b>order</b>. Most common


-- does it choose the smallest cover (there are three covers between positions (7,17), (17, 22), and (22, 31). The chosen one is (17, 22))

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'order & documents'), 'MaxFragments=1,MinWords=5,MaxWords=10');
ts_headline
-------------------------------------------------------------------------------------
... some <b>order</b>. Most common case: Find <b>documents</b> containing all query
(1 row)

-- does it show multiple fragments

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'query & documents'), 'MaxFragments=2,MinWords=5,MaxWords=10');

ts_headline
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
... find <b>documents</b>, which satisfy <b>query</b> and optionally return them... common case: Find <b>documents</b> containing all <b>query</b> terms and return
(1 row)

-- does it exclude overlapping covers (even when MaxFragments = 2, the overlapping covers are excluded)

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'query & order & documents'), 'MaxFragments=2,MinWords=5,MaxWords=15');
ts_headline
---------------------------------------------------------------------------------------------------------------------
... them in some <b>order</b>. Most common case: Find <b>documents</b> containing all <b>query</b> terms and return
(1 row)


-- when cover size is greater than MaxWords, does it break covers into fragments (first with MaxFragments = 1 and then with maxFragments = 2)

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'purpose & similarity'), 'MaxFragments=1,MinWords=5,MaxWords=10');
ts_headline
---------------------------------------------------------------------
... <b>purpose</b> of FTS is to find documents, which satisfy query
(1 row)

testdb=# select ts_headline('The purpose of FTS is to find documents, which satisfy query and optionally return them in some order. Most common case: Find documents containing all query terms and return them in order of their similarity to the query.', to_tsquery('english', 'purpose & similarity'), 'MaxFragments=2,MinWords=5,MaxWords=10');
ts_headline
----------------------------------------------------------------------------------------------------------------------
... <b>purpose</b> of FTS is to find documents, which satisfy query... order of their <b>similarity</b> to the query
(1 row)

-- using Oleg suggestions for testing some boundry cases

testdb=# select ts_headline('1 2 3 4 5 1 2 3 1','1&3'::tsquery, 'MaxFragments=1');
ts_headline
-----------------------
... <b>3</b> <b>1</b>
(1 row)

testdb=# select ts_headline('1 2 3 4 5 1 2 3 1','1&3'::tsquery, 'MaxFragments=2');
ts_headline
------------------------------------------
<b>1</b> 2 <b>3</b>... <b>3</b> <b>1</b>

testdb=# select ts_headline('1 2 3 4 5 1 2 3 1','1&2'::tsquery, 'MaxFragments=2');
ts_headline
----------------------------------------
<b>1</b> <b>2</b>... <b>1</b> <b>2</b>

testdb=# select ts_headline('1 2 3 4 5 1 2 3 1','2'::tsquery, 'MaxFragments=2');
ts_headline
--------------------------
... <b>2</b>... <b>2</b>

testdb=# select ts_headline('1 2 3 4 5 1 2 3 1','1&4'::tsquery, 'MaxFragments=2');
ts_headline
-------------------------
... <b>4</b> 5 <b>1</b>
(1 row)

Index: src/test/regress/sql/tsearch.sql
===================================================================
RCS file: /home/postgres/devel/pgsql-cvs/pgsql/src/test/regress/sql/tsearch.sql,v
retrieving revision 1.9
diff -c -r1.9 tsearch.sql
*** src/test/regress/sql/tsearch.sql 16 May 2008 16:31:02 -0000 1.9
--- src/test/regress/sql/tsearch.sql 18 Jul 2008 00:57:14 -0000
***************
*** 208,213 ****
--- 208,253 ----
</html>',
to_tsquery('english', 'sea&foo'), 'HighlightAll=true');

+ --Check if headline fragments work
+ SELECT ts_headline('english', '
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop to drink.
+ S. T. Coleridge (1772-1834)
+ ', to_tsquery('english', 'ocean'), 'MaxFragments=1');
+
+ --Check if more than one fragments are displayed
+ SELECT ts_headline('english', '
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop to drink.
+ S. T. Coleridge (1772-1834)
+ ', to_tsquery('english', 'Coleridge & stuck'), 'MaxFragments=2');
+
+ --Fragments when there all query words are not in the document
+ SELECT ts_headline('english', '
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop to drink.
+ S. T. Coleridge (1772-1834)
+ ', to_tsquery('english', 'ocean & seahorse'), 'MaxFragments=1');
+
+
--Rewrite sub system

CREATE TABLE test_tsquery (txtkeyword TEXT, txtsample TEXT);
Index: src/test/regress/expected/tsearch.out
===================================================================
RCS file: /home/postgres/devel/pgsql-cvs/pgsql/src/test/regress/expected/tsearch.out,v
retrieving revision 1.14
diff -c -r1.14 tsearch.out
*** src/test/regress/expected/tsearch.out 16 May 2008 16:31:02 -0000 1.14
--- src/test/regress/expected/tsearch.out 18 Jul 2008 00:58:28 -0000
***************
*** 632,637 ****
--- 632,705 ----
</html>
(1 row)

+ --Check if headline fragments work
+ SELECT ts_headline('english', '
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop to drink.
+ S. T. Coleridge (1772-1834)
+ ', to_tsquery('english', 'ocean'), 'MaxFragments=1');
+ ts_headline
+ ------------------------------------
+ ... after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted <b>Ocean</b>.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop
+ (1 row)
+
+ --Check if more than one fragments are displayed
+ SELECT ts_headline('english', '
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop to drink.
+ S. T. Coleridge (1772-1834)
+ ', to_tsquery('english', 'Coleridge & stuck'), 'MaxFragments=2');
+ ts_headline
+ ---------------------------------------------
+ ... after day, day after day,
+ We <b>stuck</b>, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where... drop to drink.
+ S. T. <b>Coleridge</b>
+ (1 row)
+
+ --Fragments when there all query words are not in the document
+ SELECT ts_headline('english', '
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as a painted Ship
+ Upon a painted Ocean.
+ Water, water, every where
+ And all the boards did shrink;
+ Water, water, every where,
+ Nor any drop to drink.
+ S. T. Coleridge (1772-1834)
+ ', to_tsquery('english', 'ocean & seahorse'), 'MaxFragments=1');
+ ts_headline
+ ------------------------------------
+
+ Day after day, day after day,
+ We stuck, nor breath nor motion,
+ As idle as
+ (1 row)
+
--Rewrite sub system
CREATE TABLE test_tsquery (txtkeyword TEXT, txtsample TEXT);
\set ECHO none
Fixed some off by one errors pointed by Oleg and errors in excluding
overlapping fragments.

Also adding test queries and updating regression tests.

Let me know of any other changes that are needed.

-Sushant.

On Thu, 2008-07-17 at 03:28 +0400, Oleg Bartunov wrote:
> On Wed, 16 Jul 2008, Sushant Sinha wrote:
>
> > I will add test queries and their results for the corner cases in a
> > separate file. I guess the only thing I am confused about is what should
> > be the behavior of headline generation when Query items have words of
> > size less than ShortWord. I guess the answer is to ignore ShortWord
> > parameter but let me know if the answer is any different.
> >
>
> ShortWord is about headline text, it doesn't affects words in query,
> so you can't discard them from query.
>
> > -Sushant.
> >
> > On Thu, 2008-07-17 at 02:53 +0400, Oleg Bartunov wrote:
> >> Sushant,
> >>
> >> first, please, provide simple test queries, which demonstrate the right work
> >> in the corner cases. This will helps reviewers to test your patch and
> >> helps you to make sure your new version is ok. For example:
> >>
> >> =# select ts_headline('1 2 3 4 5 1 2 3 1','1&3'::tsquery);
> >> ts_headline
> >> ------------------------------------------------------
> >> <b>1</b> 2 <b>3</b> 4 5 <b>1</b> 2 <b>3</b> <b>1</b>
> >>
> >> This select breaks your code:
> >>
> >> =# select ts_headline('1 2 3 4 5 1 2 3 1','1&3'::tsquery,'maxfragments=2');
> >> ts_headline
> >> --------------
> >> ... 2 ...
> >>
> >> and so on ....
> >>
> >>
> >> Oleg
> >> On Tue, 15 Jul 2008, Sushant Sinha wrote:
> >>
> >>> Attached a new patch that:
> >>>
> >>> 1. fixes previous bug
> >>> 2. better handles the case when cover size is greater than the MaxWords.
> >>> Basically it divides a cover greater than MaxWords into fragments of
> >>> MaxWords, resizes each such fragment so that each end of the fragment
> >>> contains a query word and then evaluates best fragments based on number of
> >>> query words in each fragment. In case of tie it picks up the smaller
> >>> fragment. This allows more query words to be shown with multiple fragments
> >>> in case a single cover is larger than the MaxWords.
> >>>
> >>> The resizing of a fragment such that each end is a query word provides room
> >>> for stretching both sides of the fragment. This (hopefully) better presents
> >>> the context in which query words appear in the document. If a cover is
> >>> smaller than MaxWords then the cover is treated as a fragment.
> >>>
> >>> Let me know if you have any more suggestions or anything is not clear.
> >>>
> >>> I have not yet added the regression tests. The regression test suite seemed
> >>> to be only ensuring that the function works. How many tests should I be
> >>> adding? Is there any other place that I need to add different test cases for
> >>> the function?
> >>>
> >>> -Sushant.
> >>>
> >>>
> >>> Nice. But it will be good to resolve following issues:
> >>>> 1) Patch contains mistakes, I didn't investigate or carefully read it. Get
> >>>> http://www.sai.msu.su/~megera/postgres/fts/apod.dump.gz<http://www.sai.msu.su/%7Emegera/postgres/fts/apod.dump.gz>and load in db.
> >>>>
> >>>> Queries
> >>>> # select ts_headline(body, plainto_tsquery('black hole'), 'MaxFragments=1')
> >>>> from apod where to_tsvector(body) @@ plainto_tsquery('black hole');
> >>>>
> >>>> and
> >>>>
> >>>> # select ts_headline(body, plainto_tsquery('black hole'), 'MaxFragments=1')
> >>>> from apod;
> >>>>
> >>>> crash postgresql :(
> >>>>
> >>>> 2) pls, include in your patch documentation and regression tests.
> >>>>
> >>>>
> >>>>> Another change that I was thinking:
> >>>>>
> >>>>> Right now if cover size > max_words then I just cut the trailing words.
> >>>>> Instead I was thinking that we should split the cover into more
> >>>>> fragments such that each fragment contains a few query words. Then each
> >>>>> fragment will not contain all query words but will show more occurrences
> >>>>> of query words in the headline. I would like to know what your opinion
> >>>>> on this is.
> >>>>>
> >>>>
> >>>> Agreed.
> >>>>
> >>>>
> >>>> --
> >>>> Teodor Sigaev E-mail: teodor@sigaev.ru
> >>>> WWW:
> >>>> http://www.sigaev.ru/
> >>>>
> >>>
> >>
> >> Regards,
> >> Oleg
> >> _____________________________________________________________
> >> Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
> >> Sternberg Astronomical Institute, Moscow University, Russia
> >> Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
> >> phone: +007(495)939-16-83, +007(495)939-23-83
> >
>
> Regards,
> Oleg
> _____________________________________________________________
> Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
> Sternberg Astronomical Institute, Moscow University, Russia
> Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
> phone: +007(495)939-16-83, +007(495)939-23-83

Re: [NOVICE] updating table where one date field is null

On Fri, 18 Jul 2008 08:34:14 am Stephan Szabo wrote:
> On Fri, 18 Jul 2008, richard terry wrote:
> > I'm passing some information to postges (from gambas basic), which gets
> > the data from date type
> >
> > eg date1 as date
> > date2 as date
> >
> > (IN the postgres database the default on the date field is null)
> >
> > my problem is that postgres baulks when I"ve not put a date into one of
> > the gambas date variables with the message:
> >
> > "invalid syntax for type date '00:00:00'"
> >
> > my sql is far more complex but reduced to the date part reads something
> > like this
> >
> > insert into mytable (date1, date2) values
> >
> > ('01/01/2008','00:00:00')
>
> '00:00:00' isn't a date. Are you sure that the second isn't meant to be a
> time?
Interesting observation, I'll ask on the gambas list. In gambas one declares a
date type as per the above, and the 00:00:00 is obviously the default of an
empty date for some reason (or as you say date/time). Thanks for replying, at
least this puts me on a track.

Regards

Richard

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [HACKERS] [PATCH]-hash index improving

On Thu, Jul 17, 2008 at 7:37 PM, Dann Corbit <DCorbit@connx.com> wrote:

>> In which cases do we expect that hash indexes will beat btrees?
>
> Large table unique index equality search should be very fast with hashed
> index (and the only place where any advantage will be seen).

Yes, this is the exact use-case. Likewise, Dan has provided a good
description regarding the primary implementation goals of a disk-based
hash table.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] [PATCH]-hash index improving

On Thu, Jul 17, 2008 at 02:11:20PM -0400, Alvaro Herrera wrote:
> Kenneth Marshall escribió:
> > On Thu, Jul 17, 2008 at 12:42:39PM -0400, Alvaro Herrera wrote:
>
> > > I think having the HASHVALUE_ONLY define is not a good idea --
> > > it just makes the patch harder to read. I suggest just removing
> > > the old code and putting the new code in place. (That's why we
> > > have revision control.)
> > >
> > One thing it helps is building an old version and a new version
> > for comparative testing. Otherwise, you could end up with an
> > apples-to- oranges comparison. I certainly think that the final
> > patch should not have it, but it is useful now for testing and
> > comparisons.
>
> For this purpose I think it would be easier to have a separate tree
> with the patch, and one without it.

Here's one tree. Anyone can get an initial copy as follows:

git clone http://git.postgresql.org/git/~davidfetter/hash/.git

Xiao Meng, if you let me know where your git repo is, say by cloning
onto a machine I can see from the internet and applying your patches
to it, I can pull and let others see it :)

Yes, I know it's a little cumbersome, but we'll get something slicker
as we figure out what "slicker" really should mean.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [GENERAL] query optimization

Kevin Duffy wrote:
>
> So here are the questions for the PSQL gurus:
>
> Is getsectypekey('CFD') executing for every join (or possible join)
> between positions_gsco and security?
>
> Causing a scan of security for every possible join.
>
> Does ' (select getsectypekey('CFD') ) ' cause the getsectype()
> function to be executed once and thus
>
> allowing the index on security to be used.
>
> And of couse '5' makes things simple. The index on security is used.
>
> Am I posting this in the right. If not please help me correct my error
> and point me to the correct spot.
>

Is the function stable or volatile?

As Scott Marlowe suggested, you need to look at the explain results to
find out what the plan is in each case.

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789
Fax: 02 6773 3266
EMail: kgore4@une.edu.au


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [HACKERS] [PATCH]-hash index improving

-----Original Message-----

> From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Simon Riggs
> Sent: Thursday, July 17, 2008 4:10 PM

> To: Jonah H. Harris

> Cc: Xiao Meng; pgsql-hackers@postgresql.org; Kenneth Marshall

> Subject: Re: [HACKERS] [PATCH]-hash index improving

>

>

> On Thu, 2008-07-17 at 16:24 -0400, Jonah H. Harris wrote:

> > I'm not really seeing any performance improvements over b-tree.

>

> I'd like to see a theoretical analysis on the benefit case before we

> spend too many teraflops on investigation.

>

> In which cases do we expect that hash indexes will beat btrees?

Large table unique index equality search should be very fast with hashed
index (and the only place where any advantage will be seen). Hashed
indexes are useless for any search besides equality and gain more and
more when the levels of the b-tree index increase.

Here is a hash index lookup that is frightfully fast:
http://www.corpit.ru/mjt/tinycdb.html

It's a constant database, but the file format might be worth
examination. Here is a quickie definition of the CDB format:
http://cr.yp.to/cdb/cdb.txt

I think that the problem with hashed indexes tends to be the blocking of
index pages on disk. For instance, the FastDB/GigaBase author was able
to make FastDB memory based hash indexes that are faster than the memory
based b-tree versions, but not for the disk based GigaBase database.
The only way to get better performance from hash based indexes is to
read fewer index pages than if a tree-based index were used. So I think
that the scheme used to create the index pages is the focus to make them
worthwhile.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

[HACKERS] TABLE-function patch vs plpgsql

I've been working on the TABLE-function patch, and I am coming to the
conclusion that it's really a bad idea for plpgsql to not associate
variables with output columns --- that is, I think we should make
RETURNS TABLE columns semantically just the same as OUT parameters.
Here are some reasons:

1. It's ludicrous to argue that "standards compliance" requires the
behavior-as-submitted. plpgsql is not specified by the SQL standard.

2. Not having the parameter names available means that you don't have
access to their types either, which is a big problem for polymorphic
functions. Read the last couple paragraphs of section 38.3.1:
http://developer.postgresql.org/pgdocs/postgres/plpgsql-declarations.html#PLPGSQL-DECLARATION-ALIASES
as well as the following 38.3.2. How would you do those things with
a polymorphic TABLE column?

3. Not treating the parameters as assignable variables makes RETURN NEXT
nearly worthless in a TABLE function. Since they're not assignable,
you can't use the parameterless form of RETURN NEXT (which'd return
the current values of the variables). The only alternative available
is to return a record or row variable; but there's no convenient way
to declare such a variable, since after all the whole point here is
that the function's output rowtype is anonymous.

4. It's a whole lot easier to explain things if we can just say that
OUT parameters and TABLE parameters work alike. This is especially
true when they actually *are* alike for all the other available PLs.

If we insist on the current definition then we are eventually going to
need to kluge up some solutions to #2 and #3, which seems like make-work
to me when we already have smooth solutions to these problems for
OUT parameters.

Comments?

For the archives, here is the patch as I currently have it (with the
no-plpgsql-variables behavior). But unless I hear a good argument
to the contrary, I'm going to change that part before committing.

regards, tom lane

Re: [PERFORM] index scan cost

On Fri, 18 Jul 2008, Dennis Brakhane wrote:

> The "fast" server makes a much more accurate estimation of the number
> of rows to expect (4 rows are returning, 1 was estimated). The "slow"
> server estimates 1151 rows. Try running ANALYZE on the slow one

You're quite right. I probably didn't mention that the slow one has been
analyzed several times. In fact, every time adjusted the statistics target
for that column I analyzed, thus the eventually better, but still inaccurate
estimates toward the bottom of the post.

--
Jeff Frost, Owner <jeff@frostconsultingllc.com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Re: [HACKERS] [PATCH]-hash index improving

On Thu, 2008-07-17 at 16:24 -0400, Jonah H. Harris wrote:
> I'm not really seeing any performance improvements over b-tree.

I'd like to see a theoretical analysis on the benefit case before we
spend too many teraflops on investigation.

In which cases do we expect that hash indexes will beat btrees?

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [PATCHES] Is autovacuum doing a wraparound-avoiding VACUUM?

On Thu, 2008-07-17 at 17:10 -0400, Alvaro Herrera wrote:
> Simon Riggs wrote:
> >
> > Is autovacuum doing a wraparound-avoiding VACUUM?
> > Currently, no easy way to tell.
> >
> > Patch to change message of autovac in pg_stat_activity when we are
> > performing an anti-wraparound VACUUM.
>
> I just obsoleted this patch. The new patch should be easier to do
> though -- just a one line change I think.
>
> I don't like your wording though; it feels too verbose (and you're
> losing the ANALYZE in case it's doing both things). How about
>
> snprintf(activity, MAX_AUTOVAC_ACTIV_LEN,
> "autovacuum: VACUUM%s%s", vac
> tab->at_doanalyze ? " ANALYZE" : "",
> tab->at_wraparound ? " (wraparound)" : "");

Yes, looks good.

Losing the ANALYZE was conscious, but in retrospect is something we
might live to regret. Yours is better.

> You're not proposing it for 8.3 right?

I think I am. It's an important diagnostic for your other fix.

We need to be able to tell the difference between a wraparound and other
weird situations.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support


--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Re: [PERFORM] index scan cost

The "fast" server makes a much more accurate estimation of the number
of rows to expect (4 rows are returning, 1 was estimated). The "slow"
server estimates 1151 rows. Try running ANALYZE on the slow one

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[HACKERS] Patch to eliminate duplicate b64 code from pgcrypto

Index: contrib/pgcrypto/pgp-armor.c
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pgcrypto/pgp-armor.c,v
retrieving revision 1.3
diff -c -r1.3 pgp-armor.c
*** contrib/pgcrypto/pgp-armor.c 15 Oct 2005 02:49:06 -0000 1.3
--- contrib/pgcrypto/pgp-armor.c 17 Jul 2008 22:37:27 -0000
***************
*** 30,181 ****
*/

#include "postgres.h"

#include "px.h"
#include "mbuf.h"
#include "pgp.h"

/*
- * BASE64 - duplicated :(
- */
-
- static const unsigned char _base64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- static int
- b64_encode(const uint8 *src, unsigned len, uint8 *dst)
- {
- uint8 *p,
- *lend = dst + 76;
- const uint8 *s,
- *end = src + len;
- int pos = 2;
- unsigned long buf = 0;
-
- s = src;
- p = dst;
-
- while (s < end)
- {
- buf |= *s << (pos << 3);
- pos--;
- s++;
-
- /*
- * write it out
- */
- if (pos < 0)
- {
- *p++ = _base64[(buf >> 18) & 0x3f];
- *p++ = _base64[(buf >> 12) & 0x3f];
- *p++ = _base64[(buf >> 6) & 0x3f];
- *p++ = _base64[buf & 0x3f];
-
- pos = 2;
- buf = 0;
- }
- if (p >= lend)
- {
- *p++ = '\n';
- lend = p + 76;
- }
- }
- if (pos != 2)
- {
- *p++ = _base64[(buf >> 18) & 0x3f];
- *p++ = _base64[(buf >> 12) & 0x3f];
- *p++ = (pos == 0) ? _base64[(buf >> 6) & 0x3f] : '=';
- *p++ = '=';
- }
-
- return p - dst;
- }
-
- /* probably should use lookup table */
- static int
- b64_decode(const uint8 *src, unsigned len, uint8 *dst)
- {
- const uint8 *srcend = src + len,
- *s = src;
- uint8 *p = dst;
- char c;
- unsigned b = 0;
- unsigned long buf = 0;
- int pos = 0,
- end = 0;
-
- while (s < srcend)
- {
- c = *s++;
- if (c >= 'A' && c <= 'Z')
- b = c - 'A';
- else if (c >= 'a' && c <= 'z')
- b = c - 'a' + 26;
- else if (c >= '0' && c <= '9')
- b = c - '0' + 52;
- else if (c == '+')
- b = 62;
- else if (c == '/')
- b = 63;
- else if (c == '=')
- {
- /*
- * end sequence
- */
- if (!end)
- {
- if (pos == 2)
- end = 1;
- else if (pos == 3)
- end = 2;
- else
- return PXE_PGP_CORRUPT_ARMOR;
- }
- b = 0;
- }
- else if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
- continue;
- else
- return PXE_PGP_CORRUPT_ARMOR;
-
- /*
- * add it to buffer
- */
- buf = (buf << 6) + b;
- pos++;
- if (pos == 4)
- {
- *p++ = (buf >> 16) & 255;
- if (end == 0 || end > 1)
- *p++ = (buf >> 8) & 255;
- if (end == 0 || end > 2)
- *p++ = buf & 255;
- buf = 0;
- pos = 0;
- }
- }
-
- if (pos != 0)
- return PXE_PGP_CORRUPT_ARMOR;
- return p - dst;
- }
-
- static unsigned
- b64_enc_len(unsigned srclen)
- {
- /*
- * 3 bytes will be converted to 4, linefeed after 76 chars
- */
- return (srclen + 2) * 4 / 3 + srclen / (76 * 3 / 4);
- }
-
- static unsigned
- b64_dec_len(unsigned srclen)
- {
- return (srclen * 3) >> 2;
- }
-
- /*
* PGP armor
*/

--- 30,42 ----
*/

#include "postgres.h"
+ #include "utils/builtins.h"

#include "px.h"
#include "mbuf.h"
#include "pgp.h"

/*
* PGP armor
*/

***************
*** 215,234 ****
memcpy(pos, armor_header, n);
pos += n;

! n = b64_encode(src, len, pos);
pos += n;

if (*(pos - 1) != '\n')
*pos++ = '\n';

*pos++ = '=';
! pos[3] = _base64[crc & 0x3f];
crc >>= 6;
! pos[2] = _base64[crc & 0x3f];
crc >>= 6;
! pos[1] = _base64[crc & 0x3f];
crc >>= 6;
! pos[0] = _base64[crc & 0x3f];
pos += 4;

n = strlen(armor_footer);
--- 76,95 ----
memcpy(pos, armor_header, n);
pos += n;

! n = b64_encode((char *) src, len, (char *) pos);
pos += n;

if (*(pos - 1) != '\n')
*pos++ = '\n';

*pos++ = '=';
! pos[3] = b64_char(crc);
crc >>= 6;
! pos[2] = b64_char(crc);
crc >>= 6;
! pos[1] = b64_char(crc);
crc >>= 6;
! pos[0] = b64_char(crc);
pos += 4;

n = strlen(armor_footer);
***************
*** 356,367 ****
goto out;

/* decode crc */
! if (b64_decode(p + 1, 4, buf) != 3)
goto out;
crc = (((long) buf[0]) << 16) + (((long) buf[1]) << 8) + (long) buf[2];

/* decode data */
! res = b64_decode(base64_start, base64_end - base64_start, dst);

/* check crc */
if (res >= 0 && crc24(dst, res) != crc)
--- 217,229 ----
goto out;

/* decode crc */
! if (b64_decode((char *) (p + 1), 4, (char *) buf) != 3)
goto out;
crc = (((long) buf[0]) << 16) + (((long) buf[1]) << 8) + (long) buf[2];

/* decode data */
! res = b64_decode((char *) base64_start, base64_end - base64_start,
! (char *) dst);

/* check crc */
if (res >= 0 && crc24(dst, res) != crc)
***************
*** 373,383 ****
unsigned
pgp_armor_enc_len(unsigned len)
{
! return b64_enc_len(len) + strlen(armor_header) + strlen(armor_footer) + 16;
}

unsigned
pgp_armor_dec_len(unsigned len)
{
! return b64_dec_len(len);
}
--- 235,246 ----
unsigned
pgp_armor_enc_len(unsigned len)
{
! return b64_enc_len(NULL, len) + strlen(armor_header) +
! strlen(armor_footer) + 16;
}

unsigned
pgp_armor_dec_len(unsigned len)
{
! return b64_dec_len(NULL, len);
}
Index: src/backend/utils/adt/encode.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/adt/encode.c,v
retrieving revision 1.22
diff -c -r1.22 encode.c
*** src/backend/utils/adt/encode.c 25 Mar 2008 22:42:44 -0000 1.22
--- src/backend/utils/adt/encode.c 17 Jul 2008 22:37:28 -0000
***************
*** 214,220 ****
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
};

! static unsigned
b64_encode(const char *src, unsigned len, char *dst)
{
char *p,
--- 214,226 ----
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
};

! char
! b64_char(unsigned src)
! {
! return _base64[src & 0x3f];
! }
!
! unsigned
b64_encode(const char *src, unsigned len, char *dst)
{
char *p,
***************
*** 261,267 ****
return p - dst;
}

! static unsigned
b64_decode(const char *src, unsigned len, char *dst)
{
const char *srcend = src + len,
--- 267,273 ----
return p - dst;
}

! unsigned
b64_decode(const char *src, unsigned len, char *dst)
{
const char *srcend = src + len,
***************
*** 330,343 ****
}


! static unsigned
b64_enc_len(const char *src, unsigned srclen)
{
/* 3 bytes will be converted to 4, linefeed after 76 chars */
return (srclen + 2) * 4 / 3 + srclen / (76 * 3 / 4);
}

! static unsigned
b64_dec_len(const char *src, unsigned srclen)
{
return (srclen * 3) >> 2;
--- 336,349 ----
}


! unsigned
b64_enc_len(const char *src, unsigned srclen)
{
/* 3 bytes will be converted to 4, linefeed after 76 chars */
return (srclen + 2) * 4 / 3 + srclen / (76 * 3 / 4);
}

! unsigned
b64_dec_len(const char *src, unsigned srclen)
{
return (srclen * 3) >> 2;
Index: src/include/utils/builtins.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/utils/builtins.h,v
retrieving revision 1.318
diff -c -r1.318 builtins.h
*** src/include/utils/builtins.h 3 Jul 2008 20:58:47 -0000 1.318
--- src/include/utils/builtins.h 17 Jul 2008 22:37:28 -0000
***************
*** 677,684 ****
extern Datum byteaGetBit(PG_FUNCTION_ARGS);
extern Datum byteaSetByte(PG_FUNCTION_ARGS);
extern Datum byteaSetBit(PG_FUNCTION_ARGS);
- extern Datum binary_encode(PG_FUNCTION_ARGS);
- extern Datum binary_decode(PG_FUNCTION_ARGS);
extern Datum byteaeq(PG_FUNCTION_ARGS);
extern Datum byteane(PG_FUNCTION_ARGS);
extern Datum bytealt(PG_FUNCTION_ARGS);
--- 677,682 ----
***************
*** 692,697 ****
--- 690,704 ----
extern Datum bytea_substr_no_len(PG_FUNCTION_ARGS);
extern Datum pg_column_size(PG_FUNCTION_ARGS);

+ /* encode.c */
+ extern Datum binary_encode(PG_FUNCTION_ARGS);
+ extern Datum binary_decode(PG_FUNCTION_ARGS);
+ extern char b64_char(unsigned src);
+ extern unsigned b64_encode(const char *src, unsigned len, char *dst);
+ extern unsigned b64_decode(const char *src, unsigned len, char *dst);
+ extern unsigned b64_enc_len(const char *src, unsigned srclen);
+ extern unsigned b64_dec_len(const char *src, unsigned srclen);
+
/* version.c */
extern Datum pgsql_version(PG_FUNCTION_ARGS);

I am attaching a patch to eliminate duplicate b64_encode and decode
functions from pgcrypto, and to expose those functions for use by
add-ins (I want to use them in Veil).

The patch was made against CVS head today. It compiles and tests
successfully. Though I was unable to run pgrypto regression tests, I
did give the b64 encoding a sanity check.

I also added a b64_char() function that is now used from pgcrypto. This
allowed me to remove the duplicate _base64 character array.

I hope this is the correct place to submit the patch. The wiki
(http://wiki.postgresql.org/wiki/Submitting_a_Patch) refers to
pgsql-patches but I believe that is now deprecated.


__
Marc

Re: [NOVICE] updating table where one date field is null

On Fri, 18 Jul 2008, richard terry wrote:

> I'm passing some information to postges (from gambas basic), which gets the
> data from date type
>
> eg date1 as date
> date2 as date
>
> (IN the postgres database the default on the date field is null)
>
> my problem is that postgres baulks when I"ve not put a date into one of the
> gambas date variables with the message:
>
> "invalid syntax for type date '00:00:00'"
>
> my sql is far more complex but reduced to the date part reads something like
> this
>
> insert into mytable (date1, date2) values
>
> ('01/01/2008','00:00:00')

'00:00:00' isn't a date. Are you sure that the second isn't meant to be a
time?

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [HACKERS] [PATCH] "\ef " in psql

Abhijit Menon-Sen <ams@oryx.com> writes:
> Though I must say it would have been even MORE horrible to copy all this
> code into the backend to make pg_get_functiondef(), notwithstanding the
> extra utility of a generally-callable function.

FWIW, I just found myself forced to invent pg_get_function_arguments()
and pg_get_function_result(), because the TABLE function patch has
pushed the complexity of printing function argument and result types
well beyond the bounds of sanity. (Pavel had hacked up pg_dump and
ignored psql's \df ...) It wouldn't take a whole lot to convince me
that a pg_get_functiondef would be useful, although I don't foresee
either of those applications wanting to use it because of their
backward-compatibility constraints.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

[NOVICE] updating table where one date field is null

I'm passing some information to postges (from gambas basic), which gets the
data from date type

eg date1 as date
date2 as date

(IN the postgres database the default on the date field is null)

my problem is that postgres baulks when I"ve not put a date into one of the
gambas date variables with the message:

"invalid syntax for type date '00:00:00'"

my sql is far more complex but reduced to the date part reads something like
this

insert into mytable (date1, date2) values

('01/01/2008','00:00:00')

I wondered if anyone could volunteer a solution

Regards

Richard

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

RE: [pgsql-es-ayuda] De informix a Postgresql

Para usar las aplicaciones compiladas con aubit lo harías igual por medio de telnet o ssh, como es totalmente compatible con el i4gl vas a tener que cambiar solo el sql que no sea compatible con postgres, en aubit te ofrecen una versión modificada de postgres totalmente compatible con el informix, pero se basa en la versión 7, te recomiendo que mejor uses una versión más nueva.

 

Saludos,

 

 

Ing. César Piñera García

 

 

De: Luis Fernando Lopez Aguilar [mailto:flopezg333@gmail.com]
Enviado el: jueves, 17 de julio de 2008 02:31 p.m.
Para: Juan Carlos Barranco de Paz
CC: pgsql-es-ayuda@postgresql.org
Asunto: Re: [pgsql-es-ayuda] De informix a Postgresql

 

Sres. Gracias por la pronta respuesta

Aubit4gl seria una opcion por ser sin licencias.
Actualmente los usuarios cliente de la base de datos se conectan por medio de netterm usando protocolo telnet en la red lan y un usuario que no esta dentro de la vpn usa netterm usando protocolo ssh por medio de internet con un adsl, ahora mi pregunta es con aubit4gl para conectarse a la base de datos se usa un browser???.
Saludos cordiales
Fernando Lopez

El día 17 de julio de 2008 3:25, Juan Carlos Barranco de Paz <jcb@greccosoft.es> escribió:

Se me olvidaba , puedes utilizar el gestor de  base de datos que quieras, nosotros escogimos postgresql y fenomenal, tuvimos que revisar los datos tipo DATETIME, los querys que contenían campo[x,y] no en el codigo

4gl y poco más.

Simplemente con recompilar la aplicación ya funciona en entorno grafico,(un poco básico, pero bien). Cuando recompilas te das cuenta de todo lo que se tragaba el compilador de 4gl.

 

De: pgsql-es-ayuda-owner@postgresql.org [mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de Juan Carlos Barranco de Paz
Enviado el: jueves, 17 de julio de 2008 9:06

Asunto: RE: [pgsql-es-ayuda] De informix a Postgresql

 

Yo tuve el mismo problema, tuve que migrar nuestro erp , la  aplicación estaba desarrollada 4gl y SE, sobre SCO Open Server, La aplicación funcionaba muy bien , pero en carácter. Migramos todo a 'genero' y  solo tuvimos que cambiar interfaces, pero nada de lógica.

 

www.4js.com

 

 

De: pgsql-es-ayuda-owner@postgresql.org [mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de César Piñera García
Enviado el: jueves, 17 de julio de 2008 3:03
Para: francisco.morosini@gmail.com; pgsql-es-ayuda@postgresql.org
Asunto: RE: [pgsql-es-ayuda] De informix a Postgresql

 

Pues como que en esas anda, CodeGear (Borland) lo vendió a Embarcadero (http://www.embarcadero.com/) la versión 2007 del Delphi está buena, pero ahora con ese movimiento quien sabe que pase… aunque no deja de ser una buena herramienta de desarrollo.

 

 

De: Francisco Javier Morosini Eguren [mailto:francisco.morosini@gmail.com]
Enviado el: miércoles, 16 de julio de 2008 07:00 p.m.
Para: César Piñera García
Asunto: Re: [pgsql-es-ayuda] De informix a Postgresql

 

Delphi? is not dead?

On Wed, Jul 16, 2008 at 6:16 PM, César Piñera García <cesar@gafi.com.mx> wrote:

Si necesitas mantener los sistemas en 4gl te recomiendo aubit 4gl (http://www.aubit.com/), tiene conexión nativa a Postgres, si vas a hacer de nuevo el sistema entonces mejor algo como Delphi ó C#.

 

Saludos,

 

Ing. César Piñera García.

 

De: Luis Fernando Lopez Aguilar [mailto:flopezg333@gmail.com]
Enviado el: miércoles, 16 de julio de 2008 08:31 a.m.
Para: pgsql-es-ayuda@postgresql.org
Asunto: [pgsql-es-ayuda] De informix a Postgresql

 

Help

Que lenguaje de programacion me recomiendan utilizar para reescribir 200000 lineas de codigo escrito en informix 4gl para usar postgresql como base de datos.

Saludos cordiales
Fernando Lopez

 



__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

 

[GENERAL] autovacuum logging 8.1

Is there a way to disable some of the autovacuum logging?

I don't want to see the below log over and over again in the logfile.

postgres[85482]: [1-1] : LOG: autovacuum: processing database
"test_com"

Thanks,
Mike

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

RE: [pgsql-es-ayuda] De informix a Postgresql

Yo tuve el mismo problema, tuve que migrar nuestro erp , la  aplicación estaba desarrollada 4gl y SE, sobre SCO Open Server, La aplicación funcionaba muy bien , pero en carácter. Migramos todo a ‘genero’ y  solo tuvimos que cambiar interfaces, pero nada de lógica.

 

www.4js.com

 

 

De: pgsql-es-ayuda-owner@postgresql.org [mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de César Piñera García
Enviado el: jueves, 17 de julio de 2008 3:03
Para: francisco.morosini@gmail.com; pgsql-es-ayuda@postgresql.org
Asunto: RE: [pgsql-es-ayuda] De informix a Postgresql

 

Pues como que en esas anda, CodeGear (Borland) lo vendió a Embarcadero (http://www.embarcadero.com/) la versión 2007 del Delphi está buena, pero ahora con ese movimiento quien sabe que pase… aunque no deja de ser una buena herramienta de desarrollo.

 

 

De: Francisco Javier Morosini Eguren [mailto:francisco.morosini@gmail.com]
Enviado el: miércoles, 16 de julio de 2008 07:00 p.m.
Para: César Piñera García
Asunto: Re: [pgsql-es-ayuda] De informix a Postgresql

 

Delphi? is not dead?

On Wed, Jul 16, 2008 at 6:16 PM, César Piñera García <cesar@gafi.com.mx> wrote:

Si necesitas mantener los sistemas en 4gl te recomiendo aubit 4gl (http://www.aubit.com/), tiene conexión nativa a Postgres, si vas a hacer de nuevo el sistema entonces mejor algo como Delphi ó C#.

 

Saludos,

 

Ing. César Piñera García.

 

De: Luis Fernando Lopez Aguilar [mailto:flopezg333@gmail.com]
Enviado el: miércoles, 16 de julio de 2008 08:31 a.m.
Para: pgsql-es-ayuda@postgresql.org
Asunto: [pgsql-es-ayuda] De informix a Postgresql

 

Help

Que lenguaje de programacion me recomiendan utilizar para reescribir 200000 lineas de codigo escrito en informix 4gl para usar postgresql como base de datos.

Saludos cordiales
Fernando Lopez

 



__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 3274 (20080716) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

[BUGS] BUG #4312: Installation fails

The following bug has been logged online:

Bug reference: 4312
Logged by: Bhaskar Sirohi
Email address: bhaskar.sirohi@druvaa.com
PostgreSQL version: 8.3.3
Operating system: Windows 2003 Server
Description: Installation fails
Details:

I tried to install Postresql 8.3.3 on the server. Install autocreates user,
but when it comes to start the
service, I am told that the users do not have enough rights.

Also see the installation log:

Property(C): OutOfDiskSpace = 0
Property(C): OutOfNoRbDiskSpace = 0
Property(C): PrimaryVolumeSpaceAvailable = 0
Property(C): PrimaryVolumeSpaceRequired = 0
Property(C): PrimaryVolumeSpaceRemaining = 0
Property(C): INSTALLLEVEL = 1
=== Logging stopped: 03.07.2008 14:30:21 ===
MSI (c) (DC:E8) [14:30:21:943]: Note: 1: 1708
MSI (c) (DC:E8) [14:30:21:943]: Note: 1: 2205 2: 3: Error
MSI (c) (DC:E8) [14:30:21:943]: Note: 1: 2228 2: 3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1708
MSI (c) (DC:E8) [14:30:21:959]: Note: 1: 2205 2: 3: Error
MSI (c) (DC:E8) [14:30:21:959]: Note: 1: 2228 2: 3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709
MSI (c) (DC:E8) [14:30:21:959]: Product: PostgreSQL 8.3 -- Installation
failed.

MSI (c) (DC:E8) [14:30:21:975]: Grabbed execution mutex.
MSI (c) (DC:E8) [14:30:21:975]: Cleaning up uninstalled install packages, if
any exist
MSI (c) (DC:E8) [14:30:21:975]: MainEngineThread is returning 1603
=== Verbose logging stopped: 03.07.2008 14:30:21 ===

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs