Wednesday, September 3, 2008

[COMMITTERS] libpqtypes - libpqtypes: error in comment, attrsize no longer exists

Log Message:
-----------
error in comment, attrsize no longer exists

Modified Files:
--------------
libpqtypes/src:
handler.c (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/src/handler.c.diff?r1=1.4&r2=1.5)

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

[COMMITTERS] libpqtypes - libpqtypes: comment in events.c still said hooks.c

Log Message:
-----------
comment in events.c still said hooks.c

Modified Files:
--------------
libpqtypes/src:
events.c (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/src/events.c.diff?r1=1.1&r2=1.2)

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

[PATCHES] libpq events patch

This is an updated version pf the libpqevents patch. See

http://archives.postgresql.org/pgsql-hackers/2008-09/msg00153.php

for details. The only change I didn't make yet is the event 'name'. I
have put it in and taken it out twice now, so a firm 'put it in there'
would be appreciated.

Go here for libpqtypes using events. pgfoundry is still using the older
object hooks version.

http://libpqtypes.esilo.com/libpqtypes-events.tar.gz

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

[GENERAL] hash partitioning

Hi folks,

 

I’m wondering why the postgres planner is not capable of determining the correct partition for a simple select for the following partitioning scheme, in which I’d like to automatically divide rows into four sub-tables, ie, a simple form of hash partitioning.

 

Any ideas why this doesn’t work, or a work around to make it work?  I would have expected the query plan below to only query the test_1 table.

 

Regards

David

 

CREATE TABLE test (

    id         int not null primary key

);

 

CREATE TABLE test_0 ( CHECK ( id % 4 = 0) ) INHERITS (test);

CREATE TABLE test_1 ( CHECK ( id % 4 = 1) ) INHERITS (test);

CREATE TABLE test_2 ( CHECK ( id % 4 = 2) ) INHERITS (test);

CREATE TABLE test_3 ( CHECK ( id % 4 = 3) ) INHERITS (test);

 

CREATE RULE test_0 AS ON INSERT TO test WHERE ( id % 4 = 0 ) DO INSTEAD INSERT INTO test_0 VALUES ( NEW.id );

CREATE RULE test_1 AS ON INSERT TO test WHERE ( id % 4 = 1 ) DO INSTEAD INSERT INTO test_1 VALUES ( NEW.id );

CREATE RULE test_2 AS ON INSERT TO test WHERE ( id % 4 = 2 ) DO INSTEAD INSERT INTO test_2 VALUES ( NEW.id );

CREATE RULE test_3 AS ON INSERT TO test WHERE ( id % 4 = 3 ) DO INSTEAD INSERT INTO test_3 VALUES ( NEW.id );

 

insert into test values(1);

 

explain analyse select * from test;

"Result  (cost=0.00..170.00 rows=12000 width=4) (actual time=0.027..0.042 rows=1 loops=1)"

"  ->  Append  (cost=0.00..170.00 rows=12000 width=4) (actual time=0.020..0.032 rows=1 loops=1)"

"        ->  Seq Scan on test  (cost=0.00..34.00 rows=2400 width=4) (actual time=0.002..0.002 rows=0 loops=1)"

"        ->  Seq Scan on test_0 test  (cost=0.00..34.00 rows=2400 width=4) (actual time=0.001..0.001 rows=0 loops=1)"

"        ->  Seq Scan on test_1 test  (cost=0.00..34.00 rows=2400 width=4) (actual time=0.007..0.009 rows=1 loops=1)"

"        ->  Seq Scan on test_2 test  (cost=0.00..34.00 rows=2400 width=4) (actual time=0.001..0.001 rows=0 loops=1)"

"        ->  Seq Scan on test_3 test  (cost=0.00..34.00 rows=2400 width=4) (actual time=0.001..0.001 rows=0 loops=1)"

"Total runtime: 0.115 ms"

Re: [BUGS] BUG #4396: Trigger event fired "UPDATE" when "DELETE" happening via foreign key

Stephen Cuppett <Stephen.Cuppett@sas.com> writes:
> I can upload the whole schema someplace, or is attaching a few files here okay?

What would be easiest from this end is a SQL script to create the
tables, insert any test data needed, and then reproduce the problem,
starting from an empty database. A "pg_dump -s" script is usually
a good starting place for making that.

regards, tom lane

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

[GENERAL] Case sensitive full text searching

Hi all:

Is there any way to create a case sensitive full text index? My target
is to make case sensitive full text searches but I don't know how.

I could create a configurario for full text searching:

CREATE TEXT SEARCH CONFIGURATION public.myconfiguration (PARSER =
pg_catalog.default);

CREATE TEXT SEARCH DICTIONARY public.my_dict (
TEMPLATE = pg_catalog.simple,
STOPWORDS = my_stops
);

ALTER TEXT SEARCH CONFIGURATION myconfiguration
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,
word, hword, hword_part
WITH my_dict;

And then create the full text index:

CREATE INDEX textindexsensible ON documento
USING gin(to_tsvector('myconfiguration',texto));

But default behaviour of Simple Dictionary returns the lower-cased form
of the word if it isn't in stopwords list. Is there any way to change
this behaviour?

Thanks in advance,

Mario Barcala

P.S. I am using PostgreSQL 8.3


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

[pgsql-es-ayuda] Code Swarm PostgreSQL : La nube del proyecto PostgreSQL

Amigos miren esto
http://www.eqsoft.net/blog/index.php?/archives/1421-Code-Swarm-PostgreSQL-La-nube-del-proyecto-PostgreSQL.html
interesante video

--
Inscribete en las listas de APESOL
http://www.apesol.org/listas.php

Visita
http://www.eqsoft.net
Manuales, noticias, foros, etc.
--
TIP 5: ¿Has leído nuestro extenso FAQ?
http://www.postgresql.org/docs/faqs.FAQ.html

Re: [lapug] Discussion on Greenplum Presentation to LAPUG

On Thu, Aug 7, 2008 at 11:02 AM, Beth Kreitzer <bkreitzer@greenplum.com> wrote:
> 11:00 AM - 12:00 PM September 29, 2008
> Location: Greenplum will call Richard - 626 215-3321


Beth, It turns out that LAPUGs normally scheduled Meeting falls on
Halloween. We would like to reschedule this meeting for some time in
November. Would this be a problem?


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

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

Re: [HACKERS] Function call order dependency

> pgsql@mohawksoft.com writes:
>> For example I'll use the Oracle "contains" function, though this is not
>> exactly what I'm doing, it just illustrates the issue clearly.
>
>> select *, score(1) from mytable where contains(mytable.title, 'Winding
>> Road', 1) order by score(1);
>
>> The "contains" function does a match against mytable.title for the term
>> 'Winding Road' and both returns and saves an integer score which may be
>> retrieved later using the "score(...)" function.
>
> This is just a bad, bad idea. Side-effects in a WHERE-clause function
> are guaranteed to cause headaches. When (not if) it breaks, you get
> to keep both pieces.

I was kind of afraid of that. So, how could one implement such a function
set?

--
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] Cleanup of GUC units code

On Wed, 03 Sep 2008 18:32:16 +0300
Hannu Krosing <hannu@krosing.net> wrote:

> > We have had this discussion before, I even submitted a patch to
> > make them case insensitive. In retrospect I was wrong to submit
> > that patch. SQL may be case insensitive but units are not. MB !=
> > Mb != mb ,
>
> For most people they are equal, and all mean MEGABYTE(S) though
> http://en.wikipedia.org/wiki/MB has lots of other possible meanings
> for each.

O.k. there is an interesting point being made here, "For most people".

Which people exactly? Are we talking about the general populous? If so
I would argue that "most people" don't have a clue what MB, Mb, or mb
is except to say I think that means some kind of speed or capacity.

The above is not our target.

If our definition of most people is, "those who are reasonably
technically adept and will be deploying PostgreSQL in production on
some level".

If someone doesn't know the difference between Mb and MB on a
production system, I would not want them anywhere near any instance of
a production system.

If we are going to make sweeping statements (anyone on this thread)
about user-hostile and most people, then we better define what those
mean. This whole argument about making something easier (and incorrect)
for someone who doesn't exist and has not been defined.

I would be hung on this list if I made a similar argument about any
other feature.

>
> > I don't think we should encourage in any way for users to do the
> > wrong thing.
>
> Can you see any scenario where accepting case insensitive units does
> more damage than just ignoring the conf line with "incorrect" casing ?

Generally speaking, no I can't think of any damage that could be done
from mixed casing. Especially since we would only accept certain
possibilities, e.g; Mb would equal MB.

It just strikes me as really bad that a project that prides itself on
"doing it right" is willing to make this type of sacrifice. This isn't
about usability. This is about doing it wrong and actively encouraging
our users that "wrong is ok". It could also misinform the user about
what the meaning of the value means.

>
> Or do you mean we should discourage people from editing
> postgresql.conf manually and have them use some tool which prevents
> them entering "kb" ?

Well that is a whole other argument :P. I would be happy to have that
one on another thread.

Sincerely,

Joshua D. Drake

--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: 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: [pgsql-es-ayuda] PostgreSQL Spanish Documentation Project

Me sumo al proyecto de traduccion.

Sinceramente me acostumbre a leer en ingles pero al mismo tiempo me da
bronca que tengamos que recurrir a documentación en otro lenguaje ( en especial
para los cursos y para utilizar para otras personas)

Emanuel Calvo Franco
/* 3manuek */
--
TIP 1: para suscribirte y desuscribirte, visita http://archives.postgresql.org/pgsql-es-ayuda

[PERFORM] SAN and full_page_writes

I have the honor to be configuring Postgres to back into a NetApp FAS3020 via fiber.

Does anyone know if the SAN protects me from breakage due to partial page writes?

If anyone has an SAN specific postgres knowledge, I'd love to hear your words of wisdom.

For reference:
[postgres@localhost bonnie]$ ~neverett/bonnie++-1.03a/bonnie++
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost.lo 32104M 81299  94 149848  30 42747   8 45465  61 55528   4 495.5   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++

Re: [HACKERS] Window functions doc patch

2008/9/4 Erikj <er@xs4all.nl>:
> Dear Hitoshi,
>
> I noticed the folowing typo in the doc sgml:
>
> 'rownumber()', instead of 'row_number()' ( 2x )
>
> hth
>
> Erik Rijkers
>
>
>
> *** doc/src/sgml/func.sgml.orig 2008-09-03 17:20:28.130229027 +0200
> --- doc/src/sgml/func.sgml 2008-09-03 17:21:01.331907454 +0200
> ***************
> *** 10092,10100 ****
> <row>
> <entry>
> <indexterm>
> ! <primary>rownumber()</primary>
> </indexterm>
> ! <function>rownumber() OVER (ORDER BY <replaceable
> class="parameter">expression</replaceable>)</function>
> </entry>
> <entry>
> <type>bigint</type>
> --- 10092,10100 ----
> <row>
> <entry>
> <indexterm>
> ! <primary>row_number()</primary>
> </indexterm>
> ! <function>row_number() OVER (ORDER BY <replaceable
> class="parameter">expression</replaceable>)</function>
> </entry>
> <entry>
> <type>bigint</type>
>

Ah, thanks. It's my mistake. Both of SQL spec and my implementation in
pg_proc say it is row_number, not rownumber.

Regards,


--
Hitoshi Harada

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

Re: [BUGS] BUG #4397: crash in tab-complete.c

"Rudolf Leitgeb" <r.leitgeb@x-pin.com> writes:
> - Compile psql for x86_64. This can be easily done with the following
> commands:

> CFLAGS="-Os -arch x86_64" LDFLAGS="-arch x86_64" ./configure
> --disable-depend --with-pam --with-openssl
> --prefix=/Users/rleitgeb/pq_x86_64

I don't think it's really as "easy" as all that with the 8.3 source tree.
This might possibly work with CVS HEAD due to recent changes in our
build process, but I'll bet that you simply aren't getting fully 64-bit
executables this way in 8.3.

regards, tom lane

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

[COMMITTERS] libpqtypes - libpqtypes: changed PQcopyResult options and removed attrs

Log Message:
-----------
changed PQcopyResult options and removed attrs argument, added PQsetResultAttrs

Modified Files:
--------------
libpqtypes/src:
utils.c (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/src/utils.c.diff?r1=1.3&r2=1.4)

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

Re: [BUGS] BUG #4396: Trigger event fired "UPDATE" when "DELETE" happening via foreign key

"Stephen Cuppett" <stephen.cuppett@sas.com> writes:
> Description: Trigger event fired "UPDATE" when "DELETE" happening via
> foreign key

You're going to need to show a complete example if you want any help
with this. (My bet is that you've overlooked a trigger someplace...)

regards, tom lane

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

Re: [BUGS] BUG #4397: crash in tab-complete.c

Rudolf Leitgeb escreveu:
> - Compile psql for x86_64. This can be easily done with the following
> commands:
>
> CFLAGS="-Os -arch x86_64" LDFLAGS="-arch x86_64" ./configure
> --disable-depend --with-pam --with-openssl
> --prefix=/Users/rleitgeb/pq_x86_64
>
Are you using libedit, right? What is the exact version? Looking at the
backtrace, it seems to be a libedit problem. Try to update your version
or use readline instead.


--
Euler Taveira de Oliveira
http://www.timbira.com/

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

Re: [pgsql-ru-general] [ADMIN] SSL problems

Andriy Bakay <andriy@irbisnet.com> writes:
> I have problems to setup SSL for PostgreSQL server. I did all the steps
> which described in the documentation (17.8. Secure TCP/IP Connections
> with SSL), but when I try to start the PostgreSQL server the pg_ctl gave
> me: "could not start server". And nothing in the logs (I enabled all of
> them). I googled around but did not find much.

There is *no* exit path from the PG server that does not spit out an
error message someplace. Re-examine the logging setup. I don't know
how FreeBSD's package sets it up exactly, but there have been packages
in the past that just sent the postmaster's stderr to /dev/null :-(.
See here for some documentation about the settings that determine where
messages go:
http://www.postgresql.org/docs/8.3/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE

regards, tom lane

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

Re: [HACKERS] [PATCH] Cleanup of GUC units code

On Wed, 2008-09-03 at 08:20 -0700, Joshua D. Drake wrote:
> Greg Stark wrote:
> > I don't think worrying about the message we send to users is reasonable.
> > We can take responsibilty for the messages we output but punishing our
> > users to teach them a lesson is being actively user-hostile
>
> There is no arguing that MB != Mb;

The whole point of this discussion is, that mostly people expect
MB == Mb = mb == mB, especially if they see weird constructs like kB
used (k for Kilo, or actually Kibi).

> nor is there anything user-hostile behind the idea of doing it the right way.

I was not trying to expose some sinister plan, just pointing out that
users seldom expect that kind of surprise.

--------------
Hannu

--
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] Oracle and Postgresql


I don't know if Oracle changed recently, but the last few times I used it, it was incredibly annoying having to put everything in a subquery to get a LIMIT-type operation to work AFTER the sort, so that you could use their ROWNUM.  For example, to get the first 50 rows of a SELECT result.  Their ROWNUM worked BEFORE the ORDER BY, so to get the 1st 50 rows, you had to put the query in a subselect, and say SELECT ... where ROWNUM <= 50.

I love OFFSET ... LIMIT in PostgreSQL!  I do a lot of web applications, and it is incredibly handy to page output with.

Susan

----------------------------------------------------
Tiered Data Protection Made Simple
http://www.overlandstorage.com/
----------------------------------------------------

Re: [HACKERS] [PATCH] Cleanup of GUC units code

On Wed, 2008-09-03 at 07:52 -0700, Joshua D. Drake wrote:
> Hannu Krosing wrote:
> > On Tue, 2008-09-02 at 16:50 +0300, Peter Eisentraut wrote:
> >> Gregory Stark wrote:
> >>> Peter Eisentraut <peter_e@gmx.net> writes:
>
> > Are you really afraid that someone would want to use mb to mean
> > millibits ?
> >
> > As SQL is generally case insensitive, it is quite surprising to most
> > people that GUC units are not.
>
> We have had this discussion before, I even submitted a patch to make
> them case insensitive. In retrospect I was wrong to submit that patch.
> SQL may be case insensitive but units are not. MB != Mb != mb ,

For most people they are equal, and all mean MEGABYTE(S) though
http://en.wikipedia.org/wiki/MB has lots of other possible meanings for
each.

> I don't think we should encourage in any way for users to do the wrong thing.

Can you see any scenario where accepting case insensitive units does
more damage than just ignoring the conf line with "incorrect" casing ?

Or do you mean we should discourage people from editing postgresql.conf
manually and have them use some tool which prevents them entering "kb" ?

----------------
Hannu

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

[HACKERS] Window functions doc patch

Dear Hitoshi,

I noticed the folowing typo in the doc sgml:

'rownumber()', instead of 'row_number()' ( 2x )

hth

Erik Rijkers

*** doc/src/sgml/func.sgml.orig 2008-09-03 17:20:28.130229027 +0200
--- doc/src/sgml/func.sgml 2008-09-03 17:21:01.331907454 +0200
***************
*** 10092,10100 ****
<row>
<entry>
<indexterm>
! <primary>rownumber()</primary>
</indexterm>
! <function>rownumber() OVER (ORDER BY <replaceable
class="parameter">expression</replaceable>)</function>
</entry>
<entry>
<type>bigint</type>
--- 10092,10100 ----
<row>
<entry>
<indexterm>
! <primary>row_number()</primary>
</indexterm>
! <function>row_number() OVER (ORDER BY <replaceable
class="parameter">expression</replaceable>)</function>
</entry>
<entry>
<type>bigint</type>

--
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] Question regarding the database page layout.

Gregory Stark <stark@enterprisedb.com> writes:
> I could do the janitorial work again if we're interested.

I think it'd make more sense to do it incrementally rather than in one
big-bang patch ...

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

[ADMIN] rpm install not recognized by yum.

one of our servers had the pgdg rpms (8.2.4) installed by hand. now
that the yum repo is available, i installed
pgdg-redhat-8.2-4.noarch.rpm. this is on
redhat-release-5Server-5.2.0.4. i do a yum update and the rpms are not
being recognized. how come? also when i performed yum clean all i get
the message "Repository pgdg82 is listed more than once in the
configuration". although i only see one declaration of pgdg82, the
other is pgdg82-source. Anyone have this issue?


# cat /etc/yum.repos.d/pgdg-82-redhat.repo
[pgdg82]
name=PostgreSQL 8.2 $releasever - $basearch
baseurl=http://yum.pgsqlrpms.org/8.2/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG

[pgdg82-source]
name=PostgreSQL 8.2 $releasever - $basearch - Source
failovermethod=priority
baseurl=http://yum.pgsqlrpms.org/srpms/8.2/redhat/rhel-$releasever-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG

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

Re: [GENERAL] immutable functions and enumerate type casts in indexes

Tom Lane ha scritto:
> Edoardo Panfili <edoardo@aspix.it> writes:
>> labelDatum = DirectFunctionCall1(enum_out,datumIbrido);
>> label = (char *) DatumGetPointer(labelDatum);
>
> Just FYI, preferred style for the second line would be
>
> label = DatumGetCString(labelDatum);
>
> Nearly all standard data types have DatumGetFoo and FooGetDatum
> macros to hide the conversion details (even if it's only a cast).

the clean version:
--------------------------------------------------------------
#include "utils/builtins.h"

PG_FUNCTION_INFO_V1(esterna_nome);
Datum esterna_nome(PG_FUNCTION_ARGS){
Datum datumIbrido = PG_GETARG_DATUM(0);
Datum labelDatum;
char *label;

labelDatum = DirectFunctionCall1(enum_out,datumIbrido);
label = DatumGetCString(labelDatum);
if(strcmp(label,("label_constant"))==0){
...
}
...
}
--------------------------------------------------------------


thank you again!
Edoardo

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

[ADMIN] PostgreSQL and ZFS

Hello  all,
 
I am working with a PostgreSQL Database and I want to change the Filesystem to ZFS.
 
Does someone have experience with PostgreSQL and its Performance with ZFS? Are the current write options for PostgreSQL suitable for ZFS?
 
Do I need to finetune Postgres with the settings for ZFS?
Like finetuning of...
- fsync
- wal_sync_method
 
Thanks if someone can help me on this.
 
Cheers Thomas

Re: [SQL] order of rows in update

Στις Wednesday 03 September 2008 15:28:04 ο/η Richard Broersma έγραψε:
> On Tue, Sep 2, 2008 at 11:56 PM, Achilleas Mantzios
> <achill@matrix.gatewaynet.com> wrote:
> > I am using my version of DB mirror to do some kind of "Conditional row grained + FK dependency oriented lazy replication".
> > (The logic behind it is the cost of comms, because the slaves are servers in vessels in all 7 seas, where communication is done
> > via uucp connections over satellite dilaup, and the costs are really high, so the aim was to minimize the costs.
> > Regarding high costs, It was so in 2003/2004 when we started designing/deploying this system and the prices are still high
> > today.)
>
> If you are ever in LA, you should come to a LAPUG meeting. One of our
> members also replicates over long distances. He is replicating from
> California to China using a highly configured slony in combination
> with other software. His software analyzes the possible routes he has
> to find the routes with the best latency. He has configures a
> revolving Master-Slave replication.
Thanx for your help.
I live in Greece, but it would be nice some time to visit America/LA :)
>
> Perhaps you guys to share notes?
>
>
> --
> Regards,
> Richard Broersma Jr.
>
> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
> http://pugs.postgresql.org/lapug
>

--
Achilleas Mantzios

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

Re: [HACKERS] [PATCH] Cleanup of GUC units code

Greg Stark wrote:
> I don't think worrying about the message we send to users is reasonable.
> We can take responsibilty for the messages we output but punishing our
> users to teach them a lesson is being actively user-hostile

There is no arguing that MB != Mb; nor is there anything user-hostile
behind the idea of doing it the right way.

Sincerely,

Joshua D. Drake


--
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] vacuum analyze hurts performance

aderose <aderose@tripology.com> writes:
> Starting with a database where analyze has never been run I get worse
> performance after running it -- is there something I'm missing?

Well, not basing such a sweeping statement on a single query example
would be a good start ;-). This particular plan might have got a little
worse but I'm sure some further investigation would show other cases
that got better.

If you want to nudge it back towards the indexscan plan, reducing
random_page_cost a bit would probably do the trick. But that's
definitely not a parameter you want to adjust on the basis of only
one test case.

regards, tom lane

--
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] Function call order dependency

pgsql@mohawksoft.com wrote:
>Would it be something like: "where" clause first, left to right, followed
>by select terms, left to right, and lastly the "order by" clause?

I don't know what ANSI says, nor do I know what PostgreSQL exactly does
at the moment, but, the only thing you can reasonably count on is that
the WHERE clause is evaluated before the SELECT-result-rows and the
ORDER BY clause (in any SQL database).

You cannot depend on any left to right order, and you cannot depend on
ORDER BY being evaluated after the SELECT-result-rows.
--
Sincerely,
Stephen R. van den Berg.

"<Clarions sounding> *No one* expects the Spanish inquisition!"

--
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] Function call order dependency

pgsql@mohawksoft.com writes:
> For example I'll use the Oracle "contains" function, though this is not
> exactly what I'm doing, it just illustrates the issue clearly.

> select *, score(1) from mytable where contains(mytable.title, 'Winding
> Road', 1) order by score(1);

> The "contains" function does a match against mytable.title for the term
> 'Winding Road' and both returns and saves an integer score which may be
> retrieved later using the "score(...)" function.

This is just a bad, bad idea. Side-effects in a WHERE-clause function
are guaranteed to cause headaches. When (not if) it breaks, you get
to keep both pieces.

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

Re: [GENERAL] immutable functions and enumerate type casts in indexes

Edoardo Panfili <edoardo@aspix.it> writes:
> labelDatum = DirectFunctionCall1(enum_out,datumIbrido);
> label = (char *) DatumGetPointer(labelDatum);

Just FYI, preferred style for the second line would be

label = DatumGetCString(labelDatum);

Nearly all standard data types have DatumGetFoo and FooGetDatum
macros to hide the conversion details (even if it's only a cast).

regards, tom lane

--
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] Cleanup of GUC units code

Hannu Krosing wrote:
> On Tue, 2008-09-02 at 16:50 +0300, Peter Eisentraut wrote:
>> Gregory Stark wrote:
>>> Peter Eisentraut <peter_e@gmx.net> writes:

> Are you really afraid that someone would want to use mb to mean
> millibits ?
>
> As SQL is generally case insensitive, it is quite surprising to most
> people that GUC units are not.

We have had this discussion before, I even submitted a patch to make
them case insensitive. In retrospect I was wrong to submit that patch.
SQL may be case insensitive but units are not. MB != Mb != mb , I don't
think we should encourage in any way for users to do the wrong thing.

Sincerely,

Joshua D. Drake


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

Re: [BUGS] Bug with FOR ... LOOP and composite types

Yes, you are right, with record type working correct;
Thanks

2008/9/2 Tom Lane <tgl@sss.pgh.pa.us>
"Oleg Serov" <serovov@gmail.com> writes:
> But if there are some records in t_table and we romove WHERE 1=0, we will
> have
> ERROR: wrong record type supplied in RETURN NEXT CONTEXT: PL/pgSQL function
> "t_func" line 9 at RETURN NEXT

I couldn't reproduce that here, at least not with versions newer than
8.0.  Maybe you were testing a case that also involved dropped columns?

                       regards, tom lane

[BUGS] BUG #4397: crash in tab-complete.c

The following bug has been logged online:

Bug reference: 4397
Logged by: Rudolf Leitgeb
Email address: r.leitgeb@x-pin.com
PostgreSQL version: 8.3.3
Operating system: OSX Leopard
Description: crash in tab-complete.c
Details:

When I compiled postgresql for different targets (i386, x86_64, ppc, ppc64)
on my Mac, tab-complete.c gave me a number of warnings, that integers are
converted to pointers. Sure enouugh, psql bombs as soon as I hit the TAB key
...

How to reproduce:

- Compile psql for x86_64. This can be easily done with the following
commands:

CFLAGS="-Os -arch x86_64" LDFLAGS="-arch x86_64" ./configure
--disable-depend --with-pam --with-openssl
--prefix=/Users/rleitgeb/pq_x86_64

make

make install

- Then connect to a database with psql and hit tab. gdb will output the
following:

postgres=#
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000809000
0x00000001001fa1dc in fn_complete ()
(gdb) bt
#0 0x00000001001fa1dc in fn_complete ()
#1 0x00000001001fbb26 in rl_complete ()
#2 0x00000001001fbb38 in rl_complete ()
#3 0x00000001001ef07b in el_gets ()
#4 0x00000001001fc0be in readline ()
#5 0x0000000100006aaa in gets_interactive ()
#6 0x000000010000725e in MainLoop ()
#7 0x000000010000a070 in main ()

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

[COMMITTERS] libpqtypes - libpqtypes: updated makefiles so they build events.c rather

Log Message:
-----------
updated makefiles so they build events.c rather than hooks.c

Modified Files:
--------------
libpqtypes:
Makefile.am (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/Makefile.am.diff?r1=1.6&r2=1.7)
Makefile.win32 (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/Makefile.win32.diff?r1=1.1&r2=1.2)
win32.mak (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/win32.mak.diff?r1=1.1&r2=1.2)

--
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-es-ayuda] Ejecutar Query periodicamente

  Ok, muchas gracias por tu ayuda...

On Tue, Sep 2, 2008 at 3:59 PM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
Daniel escribió:
>    Buenas a todos, resulta que quiero hacer que un query se ejecute cada dia
> primero del mes, para realizar respaldo de los datos a otra bd en este caso
> de historicos, me gustaria si postgres lo trae o hay que usar a el cron de
> linux (Uso Ubuntu)

Usa cron.

--
Alvaro Herrera                http://www.amazon.com/gp/registry/3BP7BYG9PUGI8
"XML!" Exclaimed C++.  "What are you doing here? You're not a programming
language."
"Tell that to the people who use me," said XML.

Re: [HACKERS] libpq object hooks (libpq events)

Alvaro Herrera wrote:
>
> There's one thing that seems a bit baroque, which is the
> PG_COPYRES_USE_ATTRS stuff in PQcopyResult. I think that flag
> introduces different enough behavior that it should be a routine of its
> own, say PQcopyResultAttrs. That way you would leave out the two extra
> params in PQcopyResult.
>
> Oh -- one last thing. I am not really sure about the flags to
> PQcopyResult. Should there really be flags to _remove_ behavior,
> instead of flags that add? i.e. instead of having "0" copy everything,
> and have to pass flags for things not to copy, wouldn't it be cleaner to
> have 0 copy only base stuff, and require flags to copy extra things?
>
> a "name" is attached to every event proc, so that it can be
> reported in error messages
>

Can someone confirm that an event 'name' should be re-introduced, as
suggested by Alvaro?

Can I get a happy or sad face in regards to below?

New options which add instead of remove.

#define PG_COPYRES_ATTRS 0x01
#define PG_COPYRES_TUPLES 0x02 /* Implies PG_COPYRES_ATTRS */
#define PG_COPYRES_EVENTS 0x04
#define PG_COPYRES_NOTICEHOOKS 0x08

// tuples implies attrs, you need the attrs to copy the tuples.
if(options & PG_COPYRES_TUPLES)
options |= PG_COPYRES_ATTRS; // auto set option

In regards to copying the attrs, the PQcopyResult still needs the
ability to copy the source result's attrs. Although, it doesn't need
the ability to provide custom attrs (which I removed). New prototype
for copyresult:

PGresult *
PQcopyResult(const PGresult *src, int options);

I then added a PQsetResultAttrs. copyresultattrs didn't seem like the
correct name because you are no longer copying attrs from a source
result. You are providing the attrs to 'set'.

int
PQsetResultAttrs(PGresult *res, int numAttributes,
PGresAttDesc *attDescs);

If the result provided to setattrs already contains attributes, I have
the function failing (can't overwrite existing attrs). I think this is
good behavior....

When PQcopyResult needs to copy the source result's attrs, it calls
PQsetResultAttrs.

/* Wants attrs */
if((options & PG_COPYRES_ATTRS) &&
!PQsetResultAttrs(dest, src->numAttributes, src->attDescs))
{
PQclear(dest);
return NULL;
}

So, there is some nice code reuse which indicates to me the code is
segmented well (copyres & setattrs).

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


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

[pgsql-fr-generale] PL/sh: Retourner une erreur

Bonjour à tous,

J'utilise le language de procédure PL/sh pour une fonction (il m'est
impératif de l'utiliser, je n'ai pas le choix...). Je souhaiterais
savoir, si quelqu'un connais bien ce langage, est-ce que je peux
retourner une erreur de la même manière qu'un RAISE EXCEPTION dans
plpgsql ?

Enfait, la fonction doit retourner un integer seulement, en cas
d'erreur, je fait un :

echo "Erreur: Description de l'erreur"

Seulement, quand j'éxécute la fonction en provoquant une erreur (ou
quand l'erreur est détectée), PostgreSQL me donne cette erreur :

ERREUR: syntaxe en entrée invalide pour l'entier : « Erreur:
Description de l'erreur »

C'est vrai que j'ai quand même l'erreur mais si ça pouvais être plus
explicite comme erreur, ça serais bien...

Merci d'avance à tout le monde !
Cordialement, Samuel ROZE.


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

Re: [pgsql-fr-generale] pgplsql: Substitution de variables

Bonjour,

Merci beaucoup, ça marche sans problèmes avec la deuxième méthode qui
est :

SELECT variable::timestamptz

(et non "::timestamp with zone" :) )

Merci !

Le mardi 02 septembre 2008 à 21:19 +0200, Guillaume Lelarge a écrit :
> Samuel ROZE a écrit :
> > Bonjour à tous (encore une fois :) ),
> >
> > Je suis actuellement confronté à un problème que je trouve assez bizare,
> > lors de la substitution de variables dans une requête SELECT :
> >
> > ----------
> > [...]
> > SELECT (timestamp with time zone "v_new_time" - timestamp with time zone
> > "v_temps") INTO v_interval;
> > [...]
> > ----------
> >
> > Cette simple commande SELECT ... INTO donne cette erreur :
> >
> > ----------
> > 7-statistiques-triggers.sql:116: ERREUR: erreur de syntaxe sur ou près
> > de « $1 » at character 37
> > QUERY: SELECT (timestamp with time zone $1 - timestamp with time zone
> > $2 )
> > CONTEXT: SQL statement in PL/PgSQL function "parse_donnees_brutes" near
> > line 66
> > ----------
> >
> > Je ne comprend pas... J'ai essayer avec des guillements simple, ça
> > marche mais après lors de l'exécution il y a un problème logique qui me
> > dit par exemple que "v_new_time n'est pas du type timestamptz"...
> >
>
> Logique car un guillemet simple indique une chaîne de caractères, et la
> chaîne de caractères 'v_new_time' ne ressemble en rien à une valeur de
> type timestamp.
>
> > Pouvez-vous m'aider ou me donner des pistes ?
> >
>
> Ton problème vient de la façon de faire ton cast. À mon avis, c'est pas
> standard du tout. Bref, tu as deux possibilités :
>
> * soit la syntaxe "::"
>
> select d1::"timestamp with time zone" - d2::timestamp with time zone
> into v;
>
> * soit utiliser cast
>
> Quelque soit ton choix, pense à placer le INTO après le SELECT,
> autrement dit :
>
> select into v d1::timestamp with time zone
> - d2::timestamp with time zone ;
>
>
> --
> Guillaume.
> http://www.postgresqlfr.org
> http://dalibo.com
>


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

[BUGS] BUG #4396: Trigger event fired "UPDATE" when "DELETE" happening via foreign key

The following bug has been logged online:

Bug reference: 4396
Logged by: Stephen Cuppett
Email address: stephen.cuppett@sas.com
PostgreSQL version: 8.3.3
Operating system: RHEL5.2 x86_64
Description: Trigger event fired "UPDATE" when "DELETE" happening via
foreign key
Details:

I have the following chain of tables:

release -> feature -> testcase -> execution -> execution_history

All tables have a parent_id column to the previous table with a foreign key
specified as ON DELETE CASCADE. One to Many the whole way down.

When I delete a release, the whole chain gets deleted.

I have this trigger defined:

CREATE OR REPLACE FUNCTION execution_history()
RETURNS trigger AS
$BODY$
BEGIN
IF (TG_OP = 'UPDATE') THEN
INSERT INTO execution_history (
execution_id, reporter, complete_units,
failed_units, blocked_units,
attempted_units, created, remote_rpt, remote_addr,
reported
) VALUES (
OLD.id, OLD.reporter, OLD.complete_units,
OLD.failed_units, OLD.blocked_units,
OLD.attempted_units, OLD.updated, OLD.remote_rpt, OLD.remote_addr,
OLD.reported
);
END IF;
RETURN NEW;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;

CREATE TRIGGER execution_history
AFTER UPDATE
ON executions
FOR EACH ROW
EXECUTE PROCEDURE execution_history();


Yet, when I go to delete a release, I get the following error:

Query: DELETE FROM "releases" WHERE "id" IN ('3')
Warning: SQL Error: ERROR: insert or update on table "execution_history"
violates foreign key constraint "execution_history_execution_id_fkey"
DETAIL: Key (execution_id)=(5830) is not present in table "executions".
CONTEXT: SQL statement "INSERT INTO execution_history ( execution_id,
reporter, complete_units, failed_units, blocked_units, attempted_units,
created, remote_rpt, remote_addr, reported ) VALUES ( $1 , $2 , $3 , $4 , $5
, $6 , $7 , $8 , $9 , $10 )" PL/pgSQL function "execution_history" line 3 at
SQL statement

I previously didn't have the TG_OP comparison, so I added the one to ensure
it was an "UPDATE". This doesn't appear to be correct behavior?

On the release and feature tables I have both an UPDATE for every row and
INSERT for every row trigger and they are *not* also firing. So I can't
figure out why this one would?

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

Re: [GENERAL] immutable functions and enumerate type casts in indexes

Martijn van Oosterhout ha scritto:
> On Tue, Sep 02, 2008 at 10:53:03AM +0200, Edoardo Panfili wrote:
>> But i have a little question about parameters of enum_out.
>> Datum enum_out(PG_FUNCTION_ARGS);
>> this is a part of my function
>> -----------------------------------------------------------
>> Datum esterna_nome2(PG_FUNCTION_ARGS){
>> int label;
>> label = enum_out(fcinfo);
>> sprintf(debug,"false enum_out: \"%s\" ",unrolled);
>> elog(LOG, debug);
>> -----------------------------------------------------------
>> but it works only because my enum parameter is the first (and using
>> fcinfo is a little obscure).
>
>
> Look in the fmgr.h header for functions like DirectFunctionCall1 and
> various other ways of calling functions.
>
Now it works! thank you to Martin and Tom.

this is a code fragment:
--------------------------------------------------------------
#include "utils/builtins.h"

PG_FUNCTION_INFO_V1(esterna_nome);
Datum esterna_nome(PG_FUNCTION_ARGS){
Datum datumIbrido = PG_GETARG_DATUM(0);
Datum labelDatum;
char *label;

labelDatum = DirectFunctionCall1(enum_out,datumIbrido);
label = (char *) DatumGetPointer(labelDatum);
if(strcmp(label,("label_constant"))==0){
...
}
...
}
--------------------------------------------------------------
I don't know why but I need <<#include "utils/builtins.h">>

The line "label = (char *) DatumGetPointer(labelDatum);" is essential to
use the information in strcmp() if I use directly labelDatum it does not
works (but it works inside a sprintf(buffer,"%s",labelDatum)).

thank you again
Edoardo


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

[ADMIN] Database encoding

Hello, I have a postgresql installed with encoding “WIN1252”.

 

But I need to create a DB with LATIN1 encoding, when I try I got the error: “Encoding Latin1 does not match server’s locale Spanish_Spain.1252. The servers’s LC_CTYPE setting require encoding WIN1252

 

 

Is possible to change the server encoding to LATIN1?

 

 

Thanks for your help!

 

 

[SQL] Case-insensitive string prefix matching with parameterized query

Apologies if this posts twice... I've run into issues with the
listserv lately.

I am implementing an autosuggest-style text input for my site, where a
user can start typing the name of a thing (call it a 'Foo'), and get a
list of all things whose name starts with the string the user typed.
For example, if the user types 'car', the database might return the
names 'Car', 'Caramel', 'Carbon', etc. I want the search to be case-
insensitive.

Just to have some code, here's some bare-bones info:

CREATE TABLE foo (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL UNIQUE,
other_info VARCHAR
);

Initially, I just did a naive match using ilike:

SELECT name FROM foo WHERE name ilike 'car%';

This worked alright when the table was small, but now my foo table has
millions of rows, and the query takes far too long. So I created a
new index on name:

CREATE INDEX lower_name_idx ON foo (lower(name));

Now I can use the query:

SELECT name FROM foo WHERE lower(name) like 'car%';

which runs in 2ms, which is exactly what I want.

My problem comes when I execute this query from my application. I'm
using Hibernate to generate the query, the code for which looks like
this:

return session()
.createCriteria( Foo.class )
.add( Restrictions.like( "name", queryString,
MatchMode.START ).ignoreCase() )
.list();

This generates the proper query... almost. It creates a parameterized
query like this:

SELECT id, name, other_info FROM foo WHERE lower(name) like $1;

where "$1" gets substituted with (for example) 'car%'. This query
runs very slowly and doesn't use the index. I think what's happening
is that when the parameterized query gets created, the planner doesn't
know that it's going to be matching at the beginning of the string
(indicated by the trailing percent character), and so it doesn't use
the index. That information comes into play when the parameter gets
substituted, but by then the plan has been set.

I can get it to work if I directly create an HQL query like this:
String hql = "from Foo where lower(name) like '" +
queryString.toLowerCase() + "%'";

I could also generate a SQL query that does the same thing; the fact
that I used HQL for this example is incidental. The point is that the
query isn't parameterized, so it generates the plan I want. This
works fine, but I don't like doing string manipulations like this.
Plus I have to now take care to escape the string to avoid injection
attacks.

Is there any SQL or PostgreSQL string function I could use that would
allow me to have a parameterized query that uses my index?
Alternatively, is there another index definition that would work? Is
there any Hibernate-functionality I've overlooked that would do what I
want without having to do string manipulations? Is there something
simple I've missed?

Also, if string manipulation is the best way to do this, what all
would I have to make sure I've escaped? Quotes, single quotes, and
backslashes, but anything else I'm overlooking?

Thanks for any suggestions,
Chris

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

Re: [HACKERS] Window functions patch v04 for the September commit fest

2008/9/3 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>:
> Hitoshi Harada wrote:
>>
>>> I'd suggest:
>>>
>>> 1. Implement Window node, with the capability to invoke an aggregate
>>> function, using the above API. Implement required parser/planner changes.
>>> Implement a few simple ranking aggregates using the API.
>>> 2. Implement glue to call normal aggregates through the new API
>>> 3. Implement the optimization to drop rows that are no longer needed
>>> (signal_cutoff can be a no-op until this phase)
>>> 4. Implement window framing (the frame can always be all rows in the
>>> partition, or all rows until the current row, until this phase)
>>> 5. Expose the new API to user-defined aggregates. It can be an internal
>>> API
>>> only used by built-in functions until this phase
>>>
>>> I believe you already have phase 1 in your patch, except for the API
>>> changes.
>>
>> I am willing to challenge to implement the API above, after maintain
>> the current patch adding docs and tests. Since the API includes
>> changes much more like Aggregate syntax than current patch, I'm not
>> sure if I can finish it by next commit fest, which is said to be
>> "feature freeze". For safety, remain the current patch to review
>> excluding API and executor then if I fail to finish use it for next
>> release. Git helps it by cutting a branch, does it? How do you think?
>
> We do allow changes to the user manual after the feature freeze, so I'd
> suggest concentrating on the code and tests first. Code comments and
> internal docs are important, though, for easy review.
>
> I'm sure we won't get all the way to phase 5 for 8.4, but if we can even get
> 1-3, plus some of the most important window functions, this this will be a
> great release!

OK, so first tests and internal docs/comments, then comes trying to
catch API , finally docs.

BTW, I think it is better to put together the discussion points we
have done as "general roadmap to complete window functions". It is not
about the features for the next release but is the complete tasks.
Where to go? Wiki, or my design docs?

Regards,


--
Hitoshi Harada

--
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] Oracle and Postgresql



On Wed, Sep 3, 2008 at 5:56 AM, Robert Treat <xzilla@users.sourceforge.net> wrote:
On Tuesday 02 September 2008 17:21:12 Asko Oja wrote:
> On Tue, Sep 2, 2008 at 2:09 AM, Michael Nolan <htfoot@gmail.com> wrote:
> > Oracle handles connecting to multiple databases (even on multiple/remote
> > computers) fairly seamlessly, PG does not (yet.)
>
> Stuff we do with plProxy on PostgreSQL is in some respects more advanced
> than anything Oracle has to offer :) We have hundreds of databases in quite
> complex network of remote calls and replication.
>

Yes, but it is also far more complex to install, configure, and use, compared
to something simple like oracle's dblink, which comes pre-installed, is
simple to set-up, and has a much more straight-forward syntax for use in day
to day query work. 
We are working on these matters and hopefully get some of them solved in 8.4 :)
Configure and use part is NO more complex than Oracle and has several use cases for which neither of dblinks is suitable.
Or are you claiming that calling functions is not straight forward and seamless in PostgreSQL.
But yes getting plProxy into the database might be the hurdle for many potential users.

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

[pgsql-ru-general] SSL problems

Hi Team,

I have problems to setup SSL for PostgreSQL server. I did all the steps
which described in the documentation (17.8. Secure TCP/IP Connections
with SSL), but when I try to start the PostgreSQL server the pg_ctl gave
me: "could not start server". And nothing in the logs (I enabled all of
them). I googled around but did not find much.

My spec:

FreeBSD 7.0-RELEASE-p3 amd64

PostgreSQL 8.3.3 (installed from ports):

WITH_NLS=true
WITHOUT_PAM=true
WITHOUT_LDAP=true
WITHOUT_MIT_KRB5=true
WITHOUT_HEIMDAL_KRB5=true
WITHOUT_OPTIMIZED_CFLAGS=true
WITH_XML=true
WITHOUT_TZDATA=true
WITHOUT_DEBUG=true
WITH_ICU=true
WITH_INTDATE=true

Please help.

Andriy

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

[HACKERS] Function call order dependency

Is there a knowable order in which functions are called within a query in
PostgreSQL?

For example I'll use the Oracle "contains" function, though this is not
exactly what I'm doing, it just illustrates the issue clearly.

select *, score(1) from mytable where contains(mytable.title, 'Winding
Road', 1) order by score(1);

The "contains" function does a match against mytable.title for the term
'Winding Road' and both returns and saves an integer score which may be
retrieved later using the "score(...)" function. The integer used as a
parameter in score(...) and contains(...) is an index to reference which
score you need as more than one contains(...) call may be used in single
query.

This sets up an interesting issue, how can one ensure that "contains()" is
called prior to any "score()" function on each row? Is this possible? Is
there a specific order on which you can count?

Would it be something like: "where" clause first, left to right, followed
by select terms, left to right, and lastly the "order by" clause?

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