Wednesday, May 7, 2008

[SQL] how to check if a point is contained in a polygon ?

Hello,

I'm busy to work on an application where the user can select (with
precision) an area on a map (for example the contours of a lake) and I
have to retrieve all the data (specimen observations) within this area.

I have a list of coordinates pair [(lat1, long1), (lat2, long2), (lat3,
long3), (..., ...)] which form a polygon. In my database every specimen
has a pair of coordinates where it has been collected.

Is there an SQL function to check if a point is contained in a polygon
shape (before I start to write my own) ?

I tried something like :

rodentia=> select point '(-8,25)' <@ polygon
'((-3,10),(8,18),(-3,30),(-10,20))';
ERROR: operator does not exist: point <@ polygon
HINT: No operator matches the given name and argument type(s). You may
need to add explicit type casts.

... but without success as you can see ;\

In advance thanks,
Julien

--
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52


--
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] Posting to hackers and patches lists

Brendan Jurd wrote:
> On Thu, May 8, 2008 at 12:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> > > I think it would be helpful for us to provide an infrastructure where
> > > people who don't run their own servers to store their patches at a
> > > stable URL where they can keep updating the content. I did that with
> > > the psql wrap patch and it helped me.
> >
> > Actually, I find that that is a truly awful habit and I wish that people
> > would *not* do it that way. There are two reasons why not:
> >
> > * no permanent archive of the submitted patch
> >
>
> Yes. I can see how posting a URL to a patch would be convenient, but
> having the permanent record of the patch as submitted is important.
>
> What about uploading patches to the wiki? That way we have the
> permanent record (change history), as well as the single authoritative
> location for fetching the latest version.

Right, I was assuming once the patch was uploaded it would be to our
infrastructure and would be permanent.

> > * reviewer won't know if the submitter changes the patch after he
> > downloads a copy, and in fact nobody will ever know unless the submitter
> > takes the time to compare the eventual commit to what he thinks the
> > patch is
> >
>
> Well, as long as you send another message to the lists saying "I've
> uploaded a new version of the patch, that URL again is <>". If you
> just silently update the patch without telling anybody you're bound to
> run into problems.

Yep.

--
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: [pgsql-www] [HACKERS] pg_dump additional options for performance

On Wed, 2008-05-07 at 10:17 -0400, Bruce Momjian wrote:
> Simon Riggs wrote:
> > On Wed, 2008-05-07 at 09:56 -0400, Bruce Momjian wrote:
> > > I cannot find this email in the email archives, even though it was sent
> > > to both hackers and patches. A message-id lookup fails too. For that
> > > reason, I have no URL to point to from the wiki.
> >
> > We should use Google then, 'cos it found it first time.
> >
> > http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php
>
> Ah, the joke's on you because that isn't the email. :-)

Advantage Momjian, Riggs to serve.

Or alternatively, how about I just post the patch again, so you can
reference it? :)

--
Simon Riggs
2ndQuadrant

http://www.2ndQuadrant.com


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

Re: [HACKERS] [PATCHES] Testing pg_terminate_backend()

Bruce Momjian wrote:
> Magnus Hagander wrote:
> > It looks pretty good from here. I have an output of about 50 million
> > lines, and the only FATAL stuff is the "terminating due to admin
> > command". All other errors look consistent with things like the
> > backend that creates a table gets killed, so anybody trying to
> > access that table later will fail with a does not exist error.
>
> OK, how long does a regression test take to run, and how long did you
> run the script? Then please compute the number of regression runs.

Hmm. This looks like somewhere between 10,000 and 20,000 runs.

//Magnus

--
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-www] [HACKERS] pg_dump additional options for performance

On Thu, May 8, 2008 at 12:10 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On Wed, 2008-05-07 at 09:56 -0400, Bruce Momjian wrote:
> > I cannot find this email in the email archives, even though it was sent
> > to both hackers and patches. A message-id lookup fails too. For that
> > reason, I have no URL to point to from the wiki.
>
> We should use Google then, 'cos it found it first time.
>
>

http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php
>

Message-Id seemed to work fine for me:

http://archives.postgresql.org/message-id/1202310804.29242.54.camel@ebony.site

Or perhaps you meant something different by a "message-id lookup"?

Cheers,
BJ

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

Re: [HACKERS] alter + preserving dependencies

Dimitri Fontaine <dim@hi-media.com> writes:
> My 8.3.1 installation psql \h only gives me:
> Syntax:
> ALTER VIEW name RENAME TO newname

You're not the first person to think that ALTER VIEW covers everything
that can be done to a view.

I'm starting to think that we should just make ALTER VIEW be an alias
for ALTER TABLE (rather than a separate node type as now), and then list
in the ALTER VIEW reference page all of the ALTER TABLE variants that
will work on views.

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: [HACKERS] Posting to hackers and patches lists

On Thu, May 8, 2008 at 12:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I think it would be helpful for us to provide an infrastructure where
> > people who don't run their own servers to store their patches at a
> > stable URL where they can keep updating the content. I did that with
> > the psql wrap patch and it helped me.
>
> Actually, I find that that is a truly awful habit and I wish that people
> would *not* do it that way. There are two reasons why not:
>
> * no permanent archive of the submitted patch
>

Yes. I can see how posting a URL to a patch would be convenient, but
having the permanent record of the patch as submitted is important.

What about uploading patches to the wiki? That way we have the
permanent record (change history), as well as the single authoritative
location for fetching the latest version.

> * reviewer won't know if the submitter changes the patch after he
> downloads a copy, and in fact nobody will ever know unless the submitter
> takes the time to compare the eventual commit to what he thinks the
> patch is
>

Well, as long as you send another message to the lists saying "I've
uploaded a new version of the patch, that URL again is <>". If you
just silently update the patch without telling anybody you're bound to
run into problems.

Cheers,
BJ

--
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] Posting to hackers and patches lists

Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I think it would be helpful for us to provide an infrastructure where
> > people who don't run their own servers to store their patches at a
> > stable URL where they can keep updating the content. I did that with
> > the psql wrap patch and it helped me.
>
> Actually, I find that that is a truly awful habit and I wish that people
> would *not* do it that way. There are two reasons why not:
>
> * no permanent archive of the submitted patch
>
> * reviewer won't know if the submitter changes the patch after he
> downloads a copy, and in fact nobody will ever know unless the submitter
> takes the time to compare the eventual commit to what he thinks the
> patch is

This requires the patch submitter to send an email every time they
update the URL. The problem with no archive is a problem though. It
works for me because I am around to supply versions but I see your
point --- perhaps we could make the system have a stable URL but allow
for versioning access. Maybe email is a fine interface, of course.

--
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: [pgsql-advocacy] Bolder vision of pg certification

On May 7, 2008, at 10:12 AM, Andrew Sullivan wrote:

> Hi,
>
> On Wed, May 07, 2008 at 08:57:39AM +0700, Mudy Situmorang wrote:
>>
>> I believe we should take the path of Oracle. The database company
>> that
>> become an Information Company, by their strength in education and
>> certification.
>
> That's not the only thing that Oracle did. There is an important
> difference with Oracle: Oracle Corp can restrict what any of its
> customers say about the database system by virtue of the license those
> customers agreed to, and it can also control what any employees say
> about the system. This contrast is important, because it puts
> practical limits on what an effort in the community can do.
>
> Furthermore, Oracle Corp had large amounts of money to spend on this
> certification effort. The programs you are discussing are expensive
> to operate and extremely hard to develop. This isn't something you do
> in a weekend with your friends, and still have it be valid.

The Original Poster has big plans. Very big plans. Such plans
require very large
wallets. We are not a company. We do not have the funding Oracle
has/did. Mind you, if the OP has these funds, we're willing to
accept them.

I was going to reply in more detail to the OP, but I find myself
occupied with real things in the next three weeks. Not hypotheticals
and nice-to-haves. :)

We need people willing to do heavy lifting. Not heavy thinking.

--
Dan Langille -- http://www.langille.org/
dan@langille.org

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

Re: [HACKERS] [PATCHES] Testing pg_terminate_backend()

Magnus Hagander wrote:
> It looks pretty good from here. I have an output of about 50 million
> lines, and the only FATAL stuff is the "terminating due to admin
> command". All other errors look consistent with things like the backend
> that creates a table gets killed, so anybody trying to access that
> table later will fail with a does not exist error.

OK, how long does a regression test take to run, and how long did you
run the script? Then please compute the number of regression runs.

--
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: [HACKERS] Posting to hackers and patches lists

Bruce Momjian <bruce@momjian.us> writes:
> I think it would be helpful for us to provide an infrastructure where
> people who don't run their own servers to store their patches at a
> stable URL where they can keep updating the content. I did that with
> the psql wrap patch and it helped me.

Actually, I find that that is a truly awful habit and I wish that people
would *not* do it that way. There are two reasons why not:

* no permanent archive of the submitted patch

* reviewer won't know if the submitter changes the patch after he
downloads a copy, and in fact nobody will ever know unless the submitter
takes the time to compare the eventual commit to what he thinks the
patch is

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: [pgsql-www] [HACKERS] pg_dump additional options for performance

Simon Riggs wrote:
> On Wed, 2008-05-07 at 09:56 -0400, Bruce Momjian wrote:
> > I cannot find this email in the email archives, even though it was sent
> > to both hackers and patches. A message-id lookup fails too. For that
> > reason, I have no URL to point to from the wiki.
>
> We should use Google then, 'cos it found it first time.
>
> http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php

Ah, the joke's on you because that isn't the email. :-)

I just tried looking up a sentence from the email in Google just now and
it didn't find it either.

The email is this one from March 24:

http://momjian.us/mhonarc/patches_hold/msg00062.html

The headers are:

Message-ID: 1206356303.4285.804.camel@ebony.site [Thread Prev][Thread Next][Thread Index]
Re: [HACKERS] pg_dump additional options for performance

* To: Alvaro Herrera <alvherre ( at ) commandprompt ( dot ) com>
* Subject: Re: [HACKERS] pg_dump additional options for performance
* From: Simon Riggs <simon ( at ) 2ndquadrant ( dot ) com>
* Date: Mon, 24 Mar 2008 10:58:23 +0000
* cc: Bruce Momjian <bruce ( at ) momjian ( dot ) us>, pgsql-hackers
( at ) postgresql ( dot ) org, psql-patches ( at ) postgresql ( dot ) org

It is actually a pg_dump patch you made.

--
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-www mailing list (pgsql-www@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-www

Re: [GENERAL] Is this possible in a trigger?

Fernando,

Below is a function that I hope gets you started.  It hasn't been tested, I cut and pasted from our procedure, which is rather more complex.  You didn't say what you wanted to do with the changes when you found them, this puts them in a log_audit table.  The thing to remember about python is that it's completely based on indentation, so if you have trouble, it's probably because the indent isn't correct.  Also, # means comment.   Feel free to contact me if you have questions or problems.  I'm trying to turn the world on to python!

If you don't have the python programming language installed on your db, I think this should do it:
create language plpythonu

These links could be helpful too:
http://rgruet.free.fr/PQR25/PQR2.5.html
http://www.postgresql.org/docs/8.2/static/plpython.html

Hope this helps!
Kerri

CREATE OR REPLACE FUNCTION logchange()
  RETURNS "trigger" AS
$BODY$

    plpy.debug('function: logchange')
    #check to make sure i'm called correctly, error will stop the trigger
    if TD['when'] != 'AFTER':
        plpy.error('logchange:not called AFTER')
    if TD['level'] != 'ROW':
        plpy.error('logchange:not called per ROW')

    if TD['event'] == 'UPDATE':
      # get the name of the current table.
      result = plpy.execute("select relname from pg_class where oid='%s'" % TD['relid'])
      if len(result) != 1:
        plpy.error('no table name found in pg_class')
      tblname = result[0]['relname']

      changes = ''
      # TD['new'] and 'old' are python dictionaries, so they can be traversed, in this case by the
      # dictionary keys
       for k in TD['new'].keys():
          if TD['new'][k] != TD['old'][k]:
             changes += '%s was: %s now is: %s\n\r' % (k,TD['old'][k],TD['new'][k])

      if len(changes) > 0:
        # this assumes the table has an oid, if you have your own id #, use it
        qry = 'INSERT INTO log_audit (table, id, change) values (%s,%s,'%s')" % \
          (tblname,TD['new'][oid],changes )
        plpy.debug('qry:',qry)
        result = plpy.execute(qry)
        plpy.execute('NOTIFY LOGAUDITCHANGE')
  return None
$BODY$
LANGUAGE 'plpythonu';


--
Yuma Educational Computer Consortium
Compass Development Team
Kerri Reno
kreno@yumaed.org      (928) 502-4240
.·:*¨¨*:·.   .·:*¨¨*:·.   .·:*¨¨*:·.

Re: [pgsql-advocacy] Bolder vision of pg certification

Hi,

On Wed, May 07, 2008 at 08:57:39AM +0700, Mudy Situmorang wrote:
>
> I believe we should take the path of Oracle. The database company that
> become an Information Company, by their strength in education and
> certification.

That's not the only thing that Oracle did. There is an important
difference with Oracle: Oracle Corp can restrict what any of its
customers say about the database system by virtue of the license those
customers agreed to, and it can also control what any employees say
about the system. This contrast is important, because it puts
practical limits on what an effort in the community can do.

Furthermore, Oracle Corp had large amounts of money to spend on this
certification effort. The programs you are discussing are expensive
to operate and extremely hard to develop. This isn't something you do
in a weekend with your friends, and still have it be valid.

Finally,

> PostgreSQL Global Institute (PGI)

[ . . . ]

I think you need to go back to the -certification list archives and
look at the discussion (or, depending on your view, flamewar) about
governance.

In any case, this discussion belongs on the other list.

A

--
Andrew Sullivan
ajs@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.com/

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

Re: [pgsql-www] [HACKERS] pg_dump additional options for performance

On Wed, 2008-05-07 at 09:56 -0400, Bruce Momjian wrote:
> I cannot find this email in the email archives, even though it was sent
> to both hackers and patches. A message-id lookup fails too. For that
> reason, I have no URL to point to from the wiki.

We should use Google then, 'cos it found it first time.

http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php

--
Simon Riggs
2ndQuadrant

http://www.2ndQuadrant.com


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

[HACKERS] Posting to hackers and patches lists

Folks, can we avoid posting an email to both hackers and patches lists?
I understand why people do it, but it is best avoided, I think. If you
feel the need to keep patch discussion on hackers, please post just the
patch to patches and a summary to hackers.

Or better yet, have a URL to the patch in an email to hackers.

I think it would be helpful for us to provide an infrastructure where
people who don't run their own servers to store their patches at a
stable URL where they can keep updating the content. I did that with
the psql wrap patch and it helped me.

--
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: [HACKERS] [0/4] Proposal of SE-PostgreSQL patches

KaiGai Kohei <kaigai@ak.jp.nec.com> writes:
> Tom Lane wrote:
>> * It does not come close to passing the regression tests. I saw a lot of
>> ! ERROR: unrecognized node type: 903
>> which suggests that something's been screwed up about parse analysis
>> (903 = T_A_Const, which shouldn't get further than parse analysis),

> Could you tell me what queries hit these errors?

I remember seeing it on some EXECUTEs, but you really ought to run the
tests for yourself. A *minimum* requirement on any submitted patch
is that it should pass the regression tests.

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: [pgsql-es-ayuda] RE: [pgsql-es-ayuda] curso de administración de postgres

En chile existen cursos de administracion en Postgresql ?

El día 7 de mayo de 2008 15:28, Juan Manuel Fernandez <jmfernandez@unlu.edu.ar> escribió:
+1 para el curso.

Saludos,

               Juan

El día 7 de mayo de 2008 9:46, Diego Ayala <netdiego81@gmail.com> escribió:
> Yo tambien me apunto para realizar el curso..
>
> saludos..!!!!!!
>
> El día 7 de mayo de 2008 8:41, Daniel Ferrer <daniel.ferrer@ctd.com.ar>
> escribió:
>
>
>
> > Yo tambien me apunto a este curso.
> >
> >
> >
> > -----Mensaje original-----
> > De: pgsql-es-ayuda-owner@postgresql.org
> > [mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de Martin Marques
> > Enviado el: Miércoles, 07 de Mayo de 2008 08:50 a.m.
> > Para: mariana chagra
> > CC: Postgres Ayuda
> > Asunto: Re: [pgsql-es-ayuda] curso de administración de postgres
> >
> >
> >
> >
> > mariana chagra escribió:
> > >
> > > Tambien me apunto al curso, desde Argentina.
> >
> > Para los que están en Argentina, la Universidad Nacional del Litoral va
> > a dar un curso de administración de PostgreSQL en el segundo semestre de
> > este año en la modalidad a distancia (http://www.unlvirtual.edu.ar).
> >
> > Cuando comience la difusión, les envío un mail por la lista.
> > --
> > TIP 1: para suscribirte y desuscribirte, visita
> > http://archives.postgresql.org/pgsql-es-ayuda
> >
> > No virus found in this incoming message.
> > Checked by AVG.
> > Version: 7.5.524 / Virus Database: 269.23.9/1417 - Release Date:
> 2008-05-06
> > 08:07 a.m.
> >
> >
> > No virus found in this outgoing message.
> > Checked by AVG.
> > Version: 7.5.524 / Virus Database: 269.23.9/1419 - Release Date:
> 2008-05-07
> > 07:46 a.m.
> >
> >
> > --
> > TIP 2: puedes desuscribirte de todas las listas simultáneamente
> >    (envía "unregister TuDirecciónDeCorreo" a majordomo@postgresql.org)
> >
>
>
>
> --
> Diego Ayala
--
TIP 7: no olvides aumentar la configuración del "free space map"



--
Marcelo Felipe Gonzalez Ronda
Egresado de Ingenieria Civil en Computacion e Informatica
Universidad Central de Chile
----------------2008-------------------

Re: [HACKERS] [PATCHES] Testing pg_terminate_backend()

It looks pretty good from here. I have an output of about 50 million
lines, and the only FATAL stuff is the "terminating due to admin
command". All other errors look consistent with things like the backend
that creates a table gets killed, so anybody trying to access that
table later will fail with a does not exist error.


//Magnus


Bruce Momjian wrote:
>
> Magnus, others, how is the SIGTERM testing going?
>
> ---------------------------------------------------------------------------
>
> Bruce Momjian wrote:
> > bruce wrote:
> > > Tom Lane wrote:
> > > > Bruce Momjian <bruce@momjian.us> writes:
> > > > > Tom Lane wrote:
> > > > >> The closest thing I can think of to an automated test is to
> > > > >> run repeated sets of the parallel regression tests, and each
> > > > >> time SIGTERM a randomly chosen backend at a randomly chosen
> > > > >> time. Then see if anything "funny"
> > > >
> > > > > Yep, that was my plan, plus running the parallel regression
> > > > > tests you get the possibility of >2 backends.
> > > >
> > > > I was intentionally suggesting only one kill per test cycle.
> > > > Multiple kills will probably create an O(N^2) explosion in the
> > > > set of possible downstream-failure deltas. I doubt you'd
> > > > really get any improvement in testing coverage to justify the
> > > > much larger amount of hand validation needed.
> > > >
> > > > It also strikes me that you could make some simple alterations
> > > > to the regression tests to reduce the set of observable
> > > > downstream deltas. For example, anyplace where a test loads a
> > > > table with successive INSERTs and that table is used by later
> > > > tests, wrap the INSERT sequence with BEGIN/END. Then there is
> > > > only one possible downstream delta (empty table) and not N
> > > > different possibilities for an N-row table.
> > >
> > > I have added pg_terminate_backend() to use SIGTERM and will start
> > > running tests as discussed with Tom. I will post my scripts too.
> >
> > Attached is my test script. I ran it for 14 hours (asserts on),
> > running 450 regression tests, with up to seven backends killed per
> > regression test.
> >
> > I have processed the combined regression.diffs files by pickouting
> > out all the new error messages. I don't see anything unusual in
> > there.
> >
> > Should I run it differently?
> >
> > --
> > Bruce Momjian <bruce@momjian.us>

http://momjian.us
> > EnterpriseDB

http://enterprisedb.com
> >
> > + If your life is a hard drive, Christ can be your backup. +
>
> > #!/bin/bash
> >
> > REGRESSION_DURATION=80 # average duration of regression test
> > in seconds OUTFILE=/rtmp/regression.sigterm
> >
> > # To analyze output, use:
> > # grep '^\+ *[A-Z][A-Z]*:' /rtmp/regression.sigterm | sort | uniq |
> > less
> >
> >
> > cd /pg/test/regress
> >
> > while :
> > do
> > (
> > SLEEP=`expr $RANDOM \* $REGRESSION_DURATION / 32767`
> > echo "Sleeping $SLEEP seconds"
> > sleep "$SLEEP"
> > echo "Trying kill"
> > # send up to 7 kill signals
> > for X in 1 2 3 4 5 6 7
> > do
> > psql -p 55432 -qt -c "
> > SELECT
> > pg_terminate_backend(stat.procpid) FROM (SELECT procpid FROM
> > pg_stat_activity ORDER BY random() LIMIT 1) AS stat
> > " template1 2> /dev/null
> > if [ "$?" -eq 0 ]
> > then echo "Kill sent"
> > fi
> > sleep 5
> > done
> > ) &
> > gmake check
> > wait
> > [ -s regression.diffs ] && cat regression.diffs >>
> > "$OUTFILE" done
>
>
> >
> > --
> > Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-patches
>
> --
> 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: [GENERAL] Import German Decimal Numbers

Thomas Pundt wrote:
> On Mittwoch, 7. Mai 2008, Jan Christian Dittmer wrote:
> | The (current) file is 1.4 GB so it will take ages to let awk chew on it
> | I guess.
>
> If you think awk is a bottleneck, I'd recommend using perl instead. It's waaay
> faster and should process your file within minutes if not faster.
>
isnt perl just another frontend for awk? ;)) SCNR ;)

There is also http://pgfoundry.org/projects/pgloader/
and if not already implemented it should be fairly
easy to implement a data filter within this one.

Cheers
Tino

Re: [pgsql-www] [pgsql-advocacy] National community sites @ postgresql.org?

On Wed, May 07, 2008 at 11:20:27AM +0200, Peter Eisentraut wrote:
> Am Mittwoch, 7. Mai 2008 schrieb Selena Deckelmann:
> > One way to keep our community vibrant, relevant and authentic is to
> > encourage communities to host their own stuff, on their own domains.
>
> Then again, most communities are too small that they don't have the skills and
> resources to host their own stuff properly.

It would seem that this is the advantage of Selena's "inconsistency":
helping others get started when they don't have the resources or
skills (or size of community, another possible shortcoming) is not the
same thing as building a big centralized system.

A

--
Andrew Sullivan
ajs@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.com/

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

[HACKERS] Behaviour of MERGE with complex Rules

It seems there is strange behaviour coming from trying to apply complex
Rules to the MERGE statement.

My proposal from here is to allow MERGE to work with Rules, but only
when the Rules are equivalent to simply updatable views. This would
restrict MERGE somewhat, yet be entirely compatible with SQL Standard
behaviour of MERGE, Views etc..

Let's look at some of the strangeness:

Rules allow you to define something like this

CREATE RULE foo_rule AS ON INSERT TO foo DO ALSO INSERT foo2 ...;

so that any insert into foo becomes 2 inserts, 1 into foo, 1 into foo2.
Now if we do an INSERT INTO FOO SELECT .... this gets rewritten into
1. INSERT INTO foo SELECT ...
2. INSERT INTO foo2 SELECT ...
This means that we fire statement-level insert triggers on foo and foo2.

By analogy, we might expect MERGE to behave similarly. That could be
true with trivial examples such as

MERGE INTO foo
USING (SELECT ...) ON (...)
WHEN NOT MATCHED
INSERT

though with a statement like this

MERGE INTO foo
USING (SELECT ...) ON (...)
WHEN NOT MATCHED
INSERT
WHEN MATCHED
UPDATE

what do we expect to happen exactly?

We run the MERGE statement twice, with the insert statements permuted?
But what happens with the UPDATE? Especially if there are also rules
that apply to UPDATE. Would we run it four times? No, the MERGE query
must run once and we must handle the rules within that single execution.
Which means if we do that then MERGE acts differently with Rules than
does an INSERT SELECT. Which feels like a warning...

So we must replace the INSERT with INSERT foo; INSERT foo2 and run the
MERGE. If we do this do we treat the second INSERT as a separate
statement each time it is executed? If so a statement-level trigger on
INSERT foo2 would be executed once for each row we insert. To make that
happen correctly we would need to apply the rule as if the INSERT were a
top-level statement, then execute it within MERGE as if it were not a
top-level statement (i.e. do not execute statement-level triggers for
that statement). If we have AFTER ROW triggers, should they be executed
after each execution of the sub-statement? or should they be executed in
a group at the end of the MERGE statement, as would happen if an INSERT
SELECT.

What would happen if one of the rules contained a MERGE statement? We'd
have to recursively apply rules down into the sub-statements of the
MERGE, yet unravel the trigger behaviour correctly.

All of this makes the hair on the back of my neck stand up. It's taken a
while to realise these issues exist. This feels to me like even stranger
behaviour might lurk somewhere there. This is a long way from clear
behaviour and makes me think it will be a long way from a clean and
useful implementation.

Clear, obvious behaviour for MERGE only seems possible when we have some
restrictions on rules. My proposal is to throw an "ERROR Cannot resolve
rules for MERGE statement", except when the rules meet the following
restrictions:

* allow MERGE with rules which say DO NOTHING
e.g. CREATE RULE foo_rule AS ON INSERT TO foo DO NOTHING;
That's fairly trivial

* allow MERGE when rules which are merely "redirections"
e.g. CREATE RULE foo_rule AS ON INSERT TO foo DO INSTEAD INSERT foo2
So only rules that have a single replacement statement. This is roughly
equivalent to a rule we might create to emulate a simply updatable view.

* allow rules only when all of the actions are similarly redirected, so
we only ever need to make changes to one table
i.e. SELECT, UPDATEs, INSERTs and DELETEs are all redirected

So a MERGE statement like this

MERGE INTO foo
USING (SELECT ...) ON (...)
WHEN NOT MATCHED
INSERT
WHEN MATCHED
UPDATE

with these rules

CREATE RULE foo_i AS ON INSERT TO foo DO INSTEAD INSERT foo2
CREATE RULE foo_u AS ON UPDATE TO foo DO INSTEAD UPDATE foo2
CREATE RULE foo_d AS ON DELETE TO foo DO INSTEAD DELETE foo2

would simply be equivalent to

MERGE INTO foo2
USING (SELECT ...) ON (...)
WHEN NOT MATCHED
INSERT
WHEN MATCHED
UPDATE

In fact, that might even be a better clue as to how to complete the
implementation of updatable views.

So: do we all agree with the restriction on MERGE to only work with
rules equivalent to simple updatability? If we do, should the
implementation of MERGE go on hold until after updatable views are added
(with the required hooks)?

--
Simon Riggs
2ndQuadrant

http://www.2ndQuadrant.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: [PATCHES] [badalex@gmail.com: Re: [BUGS] Problem identifying constraints which should not be inherited]

"Alex Hunsaker" <badalex@gmail.com> writes:
> Currently this loops through all the constraints for a relation (old
> behavior of MergeAttributesIntoExisting)... Do you think its worth
> adding a non-unique index to speed this up?

No. If we were to refactor pg_constraint as I mentioned earlier,
then it could have a natural primary key (reloid, constrname)
(replacing the existing nonunique index on reloid) and then a number
of things could be sped up. But just piling more indexes on a
fundamentally bad design doesn't appeal to me ...

Will review the revised patch today.

regards, tom lane

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

Re: [pgsql-www] [pgsql-advocacy] National community sites @ postgresql.org?

On Wed, May 7, 2008 at 2:20 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
> Am Mittwoch, 7. Mai 2008 schrieb Selena Deckelmann:
>> One way to keep our community vibrant, relevant and authentic is to
>> encourage communities to host their own stuff, on their own domains.
>
> Then again, most communities are too small that they don't have the skills and
> resources to host their own stuff properly.

I'm not saying we should get rid of the PUGS site -- it is a valuable
resource. DNS-based redirection for language/regional-based sites
would be very useful. Especially in Nikolay's case.

Those that have the resources, should continue to run their own sites.

Here's the list of organizations, communities and user groups hosting
their own sites (that I know of):

JPUG - a non-profit corporation, not just a user community
PgEU - same
PgUS - same
ITPUG - has formal governance
Pg.IT
Pg.PE (Peru)
Pg.Brasil
China (forums)
PostgreSQLFr (France)
PGUG (Germany)
Grupo de Usuarios PostgreSQL de Venezuela
NZPGUG (New Zealand)
Pg.Gr (Greek)
PgUK

And then we have the Czech, Polish, and Turkish sites - I'm not sure
who maintains those. There's likely more!

The .org role should be to provide an accurate directory that connects
all the sites together.

One of my goals for the PUG site is to encourage people to customize
their portion of the site - so that they are less uniform, and more
reflective of the personality of the groups. I haven't quite gotten
there yet :)

-selena

--
Selena Deckelmann
United States PostgreSQL Association - http://www.postgresql.us
PDXPUG - http://pugs.postgresql.org/pdx
Me - http://www.chesnok.com/daily

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

[COMMITTERS] pginstaller - web: Add the translation sentence of contrib/UUID.

Log Message:
-----------
Add the translation sentence of contrib/UUID.

Modified Files:
--------------
web:
en.xml (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/en.xml.diff?r1=1.1&r2=1.2)
translation.html (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/translation.html.diff?r1=1.2&r2=1.3)

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

Re: [GENERAL] Import German Decimal Numbers

On Mittwoch, 7. Mai 2008, Jan Christian Dittmer wrote:
| The (current) file is 1.4 GB so it will take ages to let awk chew on it
| I guess.

If you think awk is a bottleneck, I'd recommend using perl instead. It's waaay
faster and should process your file within minutes if not faster.

Ciao,
Thomas

--
Thomas Pundt <thomas.pundt@rp-online.de> ---- http://rp-online.de/ ----

--
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] Operaciones a nivel de bit

Puedes hacer operaciones AND, OR, XOR y NOT, en la sección 9.3 del manual de postgres se listan estos y otros operadores más.

2008/5/7 Jaime Casanova <systemguards@gmail.com>:
---------- Forwarded message ----------
From: Antonio Antonio <a2076totonio@yahoo.es>
Date: Tue, May 6, 2008 at 9:23 AM
Subject: Operaciones a nivel de bit
To: Jaime Casanova <systemguards@gmail.com>


Hola,

 ¿Es posible realizar operaciones con máscaras en
 Postgres?

 me explico mejor, me gustaria hacer una comparacion a
 nivel de bit como se hace en mysql, por ejemplo:

 and 1258458 & 458

 ¿Cual es el operados?

 Salu2 y gracias





     ______________________________________________
 Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.



--
Atentamente,
Jaime Casanova
Soporte de PostgreSQL
Guayaquil - Ecuador
Cel. (593) 087171157
--
TIP 7: no olvides aumentar la configuración del "free space map"

Re: [GENERAL] Is this possible in a trigger?

Thank you for your answer.  I guess I better create this history in the application's data class.

Klint Gore wrote:
Fernando wrote:
I want to keep a history of changes on a field in a table.  This will be the case in multiple tables.

Can I create a trigger that loops the OLD and NEW values and compares the values and if they are different creates a change string as follows:

e.g;

FOR EACH field IN NEW
    IF field.value <> OLD.field.name THEN
       changes := changes
            || field.name
            || ' was: '
            || OLD.field.value
            || ' now is: '
            || field.value
            || '\n\r';
    END IF
END FOR;

Your help is really appreciated.
You can't in plpgsql.  It doesn't have the equivalent of a walkable fields collection.  Its possible in some other procedure languages (I've seen it done in C).

Having said that, you might be able to create new and old temp tables and then use the system tables to walk the columns list executing sql to check for differences.

something like

  create temp table oldblah as select old.*;
  create temp table newblah as select new.*;
  for arecord in
       select columnname
       from pg_??columns??
       join pg_??tables?? on ??columns??.xxx = ??tables??.yyy
      where tablename = oldblah and pg_table_is_visible
  loop

       execute 'select old.' || arecord.columname || '::text , new. ' || arecord.columname || '::text' ||
                   ' from oldblah old, newblah new ' ||
                   ' where oldblah.' || arecord.columnname || ' <> newblah.' ||arecord.columnname    into oldval,newval;

      changes := changes || arecord.columnname || ' was ' || oldval || ' now ' || newval;
  end loop;
  execute 'drop table oldblah';
  execute 'drop table newblah';

performance could be awful though.

klint.

Re: [HACKERS] [0/4] Proposal of SE-PostgreSQL patches

On Wed, May 07, 2008 at 12:01:21AM -0400, Greg Smith wrote:

> It may be the case that clean row and column filtering at the SQL layer are
> pre-requisites for a clean SELinux implementation, where the only
> difference is that the permission checks are handled by asking SELinux
> instead of looking in the catalog.

That strikes me as an approach more likely to be fruitful.

I get the point about imposing all the restrictions at the SELinux
layer. But the way to do that, I think, is to make the individual
policies possible to implement in PostgreSQL simpliciter, and then
have some interface to the SELinux permissions system so that it
becomes possible to set those definitions outside Postgres. (I know
that the latter raises all sorts of nasty DoS scenarios. That's
clearly one of the problems that will need addressing.)

Again, I support the effort in principle; I'm just not sure that the
current proof-of-concept work is what will be needed to address the
design goals. I do think that somewhat clearer scope definitions
would be a big help in deciding which modifications are really needed,
and where.

A

--
Andrew Sullivan
ajs@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.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-es-ayuda] Curso

Si se puede, yo tambien me apunto al curso...


______________________________________________
Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.
--
TIP 4: No hagas 'kill -9' a postmaster

Re: [HACKERS] [PATCHES] Testing pg_terminate_backend()

Magnus, others, how is the SIGTERM testing going?

---------------------------------------------------------------------------

Bruce Momjian wrote:
> bruce wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <bruce@momjian.us> writes:
> > > > Tom Lane wrote:
> > > >> The closest thing I can think of to an automated test is to run repeated
> > > >> sets of the parallel regression tests, and each time SIGTERM a randomly
> > > >> chosen backend at a randomly chosen time. Then see if anything "funny"
> > >
> > > > Yep, that was my plan, plus running the parallel regression tests you
> > > > get the possibility of >2 backends.
> > >
> > > I was intentionally suggesting only one kill per test cycle. Multiple
> > > kills will probably create an O(N^2) explosion in the set of possible
> > > downstream-failure deltas. I doubt you'd really get any improvement
> > > in testing coverage to justify the much larger amount of hand validation
> > > needed.
> > >
> > > It also strikes me that you could make some simple alterations to the
> > > regression tests to reduce the set of observable downstream deltas.
> > > For example, anyplace where a test loads a table with successive INSERTs
> > > and that table is used by later tests, wrap the INSERT sequence with
> > > BEGIN/END. Then there is only one possible downstream delta (empty
> > > table) and not N different possibilities for an N-row table.
> >
> > I have added pg_terminate_backend() to use SIGTERM and will start
> > running tests as discussed with Tom. I will post my scripts too.
>
> Attached is my test script. I ran it for 14 hours (asserts on),
> running 450 regression tests, with up to seven backends killed per
> regression test.
>
> I have processed the combined regression.diffs files by pickouting out
> all the new error messages. I don't see anything unusual in there.
>
> Should I run it differently?
>
> --
> Bruce Momjian <bruce@momjian.us>

http://momjian.us
> EnterpriseDB

http://enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +

> #!/bin/bash
>
> REGRESSION_DURATION=80 # average duration of regression test in seconds
> OUTFILE=/rtmp/regression.sigterm
>
> # To analyze output, use:
> # grep '^\+ *[A-Z][A-Z]*:' /rtmp/regression.sigterm | sort | uniq | less
>
>
> cd /pg/test/regress
>
> while :
> do
> (
> SLEEP=`expr $RANDOM \* $REGRESSION_DURATION / 32767`
> echo "Sleeping $SLEEP seconds"
> sleep "$SLEEP"
> echo "Trying kill"
> # send up to 7 kill signals
> for X in 1 2 3 4 5 6 7
> do
> psql -p 55432 -qt -c "
> SELECT pg_terminate_backend(stat.procpid)
> FROM (SELECT procpid FROM pg_stat_activity
> ORDER BY random() LIMIT 1) AS stat
> " template1 2> /dev/null
> if [ "$?" -eq 0 ]
> then echo "Kill sent"
> fi
> sleep 5
> done
> ) &
> gmake check
> wait
> [ -s regression.diffs ] && cat regression.diffs >> "$OUTFILE"
> done


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

--
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

[COMMITTERS] pginstaller - web: The specification of Ver8.3 is applied.

Log Message:
-----------
The specification of Ver8.3 is applied.
with Dave.

Modified Files:
--------------
web:
index.html (r1.11 -> r1.12)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/index.html.diff?r1=1.11&r2=1.12)
pginst0.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst0.png.diff?r1=1.2&r2=1.3)
pginst1.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst1.png.diff?r1=1.2&r2=1.3)
pginst10.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst10.png.diff?r1=1.2&r2=1.3)
pginst11.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst11.png.diff?r1=1.2&r2=1.3)
pginst2.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst2.png.diff?r1=1.2&r2=1.3)
pginst3.png (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst3.png.diff?r1=1.3&r2=1.4)
pginst4.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst4.png.diff?r1=1.2&r2=1.3)
pginst5.png (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst5.png.diff?r1=1.3&r2=1.4)
pginst6.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst6.png.diff?r1=1.2&r2=1.3)
pginst7.png (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst7.png.diff?r1=1.3&r2=1.4)
pginst8.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst8.png.diff?r1=1.2&r2=1.3)
pginst9.png (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst9.png.diff?r1=1.2&r2=1.3)

Added Files:
-----------
web:
pginst12.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst12.png?rev=1.1&content-type=text/x-cvsweb-markup)
pginst13.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst13.png?rev=1.1&content-type=text/x-cvsweb-markup)
pginst14.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst14.png?rev=1.1&content-type=text/x-cvsweb-markup)
pginst15.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst15.png?rev=1.1&content-type=text/x-cvsweb-markup)
pginst16.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst16.png?rev=1.1&content-type=text/x-cvsweb-markup)
pginst17.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst17.png?rev=1.1&content-type=text/x-cvsweb-markup)
pginst18.png (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/web/pginst18.png?rev=1.1&content-type=text/x-cvsweb-markup)

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

SFPUG subscription

Hello,

Are you in the SF Bay Area and interested in PostgreSQL?

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

Re: [pgsql-es-ayuda] RE: [pgsql-es-ayuda] curso de administración de postgres

+1 para el curso.

Saludos,

Juan

El día 7 de mayo de 2008 9:46, Diego Ayala <netdiego81@gmail.com> escribió:
> Yo tambien me apunto para realizar el curso..
>
> saludos..!!!!!!
>
> El día 7 de mayo de 2008 8:41, Daniel Ferrer <daniel.ferrer@ctd.com.ar>
> escribió:
>
>
>
> > Yo tambien me apunto a este curso.
> >
> >
> >
> > -----Mensaje original-----
> > De: pgsql-es-ayuda-owner@postgresql.org
> > [mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de Martin Marques
> > Enviado el: Miércoles, 07 de Mayo de 2008 08:50 a.m.
> > Para: mariana chagra
> > CC: Postgres Ayuda
> > Asunto: Re: [pgsql-es-ayuda] curso de administración de postgres
> >
> >
> >
> >
> > mariana chagra escribió:
> > >
> > > Tambien me apunto al curso, desde Argentina.
> >
> > Para los que están en Argentina, la Universidad Nacional del Litoral va
> > a dar un curso de administración de PostgreSQL en el segundo semestre de
> > este año en la modalidad a distancia (http://www.unlvirtual.edu.ar).
> >
> > Cuando comience la difusión, les envío un mail por la lista.
> > --
> > TIP 1: para suscribirte y desuscribirte, visita
> > http://archives.postgresql.org/pgsql-es-ayuda
> >
> > No virus found in this incoming message.
> > Checked by AVG.
> > Version: 7.5.524 / Virus Database: 269.23.9/1417 - Release Date:
> 2008-05-06
> > 08:07 a.m.
> >
> >
> > No virus found in this outgoing message.
> > Checked by AVG.
> > Version: 7.5.524 / Virus Database: 269.23.9/1419 - Release Date:
> 2008-05-07
> > 07:46 a.m.
> >
> >
> > --
> > TIP 2: puedes desuscribirte de todas las listas simultáneamente
> > (envía "unregister TuDirecciónDeCorreo" a majordomo@postgresql.org)
> >
>
>
>
> --
> Diego Ayala
--
TIP 7: no olvides aumentar la configuración del "free space map"

Re: [GENERAL] Import German Decimal Numbers

Jan Christian Dittmer wrote:
> Thank you very much!
> You have remind me that the our server runs under Linux and not under
> Windows as our clients :-)
> So indeed I can use a sed-pipe construct to switch '.' and ','.
> But wait, there is just another problem then. Our date format is also
> german :-( "DD.MM.YY" or
> "DD.MM.YYYY". So if I just exchange '.' and ',' the date will be
> unreadable for the import :-(
> The (current) file is 1.4 GB so it will take ages to let awk chew on it
> I guess.

If all fails you could copy into a another table where you use
text columns and then translate afterwards via to_date() and
to_number() / replace().

Cheers
Tino

Re: [ADMIN] column: on update update?

On Wed, May 7, 2008 at 1:50 AM, Michael Monnerie
<michael.monnerie@it-management.at> wrote:
> But I also need the "lastupdate" be updated every time a field in that
> row is updated, so a statement like this:
>
> But it doesn't work. Do I need a trigger? If yes, what would be the
> format? I never did triggers.

Well you have two options. The perferred method would be to have your
application include an update to your lastupdate field whenever
anyother rows are updated.

UPDATE awl
SET lastupdate = CURRENT_TIMESTAMP,
....,
WHERE ....;

the other option is to add an after update trigger, and manually set
lastupdate then.


--
Regards,
Richard Broersma Jr.

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

--
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] Import German Decimal Numbers

Well if your doing an update, do it column by column and when you do a
date column replace the '.' with '/'

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Jan Christian
Dittmer
Sent: Wednesday, May 07, 2008 10:16 AM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Import German Decimal Numbers

Thank you very much!
You have remind me that the our server runs under Linux and not under
Windows as our clients :-)
So indeed I can use a sed-pipe construct to switch '.' and ','.
But wait, there is just another problem then. Our date format is also
german :-( "DD.MM.YY" or
"DD.MM.YYYY". So if I just exchange '.' and ',' the date will be
unreadable for the import :-(
The (current) file is 1.4 GB so it will take ages to let awk chew on it
I guess.

Christian

Ken Allen wrote:
> I would replace the ',' with something else such as a '#' first then
> replace the decimal with the ',' then replace the '#' with a decimal
'.'
>
> If you do the ',' with a '.' first then all of them will be '.' and
you
> wont know which ones to change.
>

> Don't know, but you can replace the , to . within the ascii-file (sed,
> awk, ...).
>
>
> Andreas

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

--
This message has been scanned by MailScanner


--
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] Import German Decimal Numbers

Thank you very much!
You have remind me that the our server runs under Linux and not under
Windows as our clients :-)
So indeed I can use a sed-pipe construct to switch '.' and ','.
But wait, there is just another problem then. Our date format is also
german :-( "DD.MM.YY" or
"DD.MM.YYYY". So if I just exchange '.' and ',' the date will be
unreadable for the import :-(
The (current) file is 1.4 GB so it will take ages to let awk chew on it
I guess.

Christian

Ken Allen wrote:
> I would replace the ',' with something else such as a '#' first then
> replace the decimal with the ',' then replace the '#' with a decimal '.'
>
> If you do the ',' with a '.' first then all of them will be '.' and you
> wont know which ones to change.
>

> Don't know, but you can replace the , to . within the ascii-file (sed,
> awk, ...).
>
>
> Andreas

--
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] Fwd: Operaciones a nivel de bit

---------- Forwarded message ----------
From: Antonio Antonio <a2076totonio@yahoo.es>
Date: Tue, May 6, 2008 at 9:23 AM
Subject: Operaciones a nivel de bit
To: Jaime Casanova <systemguards@gmail.com>


Hola,

¿Es posible realizar operaciones con máscaras en
Postgres?

me explico mejor, me gustaria hacer una comparacion a
nivel de bit como se hace en mysql, por ejemplo:

and 1258458 & 458

¿Cual es el operados?

Salu2 y gracias

______________________________________________
Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.

--
Atentamente,
Jaime Casanova
Soporte de PostgreSQL
Guayaquil - Ecuador
Cel. (593) 087171157
--
TIP 7: no olvides aumentar la configuración del "free space map"

Re: [pgsql-es-ayuda] RE: [pgsql-es-ayuda] curso de administración de postgres

Yo tambien me apunto para realizar el curso..

saludos..!!!!!!

El día 7 de mayo de 2008 8:41, Daniel Ferrer <daniel.ferrer@ctd.com.ar> escribió:
Yo tambien me apunto a este curso.



-----Mensaje original-----
De: pgsql-es-ayuda-owner@postgresql.org
[mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de Martin Marques
Enviado el: Miércoles, 07 de Mayo de 2008 08:50 a.m.
Para: mariana chagra
CC: Postgres Ayuda
Asunto: Re: [pgsql-es-ayuda] curso de administración de postgres

mariana chagra escribió:
>
> Tambien me apunto al curso, desde Argentina.

Para los que están en Argentina, la Universidad Nacional del Litoral va
a dar un curso de administración de PostgreSQL en el segundo semestre de
este año en la modalidad a distancia (http://www.unlvirtual.edu.ar).

Cuando comience la difusión, les envío un mail por la lista.
--
TIP 1: para suscribirte y desuscribirte, visita
http://archives.postgresql.org/pgsql-es-ayuda

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.9/1417 - Release Date: 2008-05-06
08:07 a.m.


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.9/1419 - Release Date: 2008-05-07
07:46 a.m.


--
TIP 2: puedes desuscribirte de todas las listas simultáneamente
   (envía "unregister TuDirecciónDeCorreo" a majordomo@postgresql.org)



--
Diego Ayala

Re: [GENERAL] Import German Decimal Numbers

I would replace the ',' with something else such as a '#' first then
replace the decimal with the ',' then replace the '#' with a decimal '.'

If you do the ',' with a '.' first then all of them will be '.' and you
wont know which ones to change.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of A. Kretschmer
Sent: Wednesday, May 07, 2008 9:38 AM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Import German Decimal Numbers

am Wed, dem 07.05.2008, um 14:25:13 +0200 mailte Jan Christian Dittmer
folgendes:
> Hi!
>
> I want to import some data from an ascii file using the COPY
sql-command.
> Unfortunatly the decimal numbers are given in german format, meaning
the
> decimal point is replaced by a comma (, instead of .). Is there any
> possiblility
> to switch the clients behaviourr (like 'set datestyle') for
> interpretation of decimals?

Don't know, but you can replace the , to . within the ascii-file (sed,
awk, ...).


Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA

http://wwwkeys.de.pgp.net

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

--
This message has been scanned by MailScanner


--
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] RE: [pgsql-es-ayuda] curso de administración de postgres

Yo tambien me apunto a este curso.

-----Mensaje original-----
De: pgsql-es-ayuda-owner@postgresql.org
[mailto:pgsql-es-ayuda-owner@postgresql.org] En nombre de Martin Marques
Enviado el: Miércoles, 07 de Mayo de 2008 08:50 a.m.
Para: mariana chagra
CC: Postgres Ayuda
Asunto: Re: [pgsql-es-ayuda] curso de administración de postgres

mariana chagra escribió:
>
> Tambien me apunto al curso, desde Argentina.

Para los que están en Argentina, la Universidad Nacional del Litoral va
a dar un curso de administración de PostgreSQL en el segundo semestre de
este año en la modalidad a distancia (http://www.unlvirtual.edu.ar).

Cuando comience la difusión, les envío un mail por la lista.
--
TIP 1: para suscribirte y desuscribirte, visita
http://archives.postgresql.org/pgsql-es-ayuda

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.9/1417 - Release Date: 2008-05-06
08:07 a.m.

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.9/1419 - Release Date: 2008-05-07
07:46 a.m.

--
TIP 2: puedes desuscribirte de todas las listas simultáneamente
(envía "unregister TuDirecciónDeCorreo" a majordomo@postgresql.org)

[COMMITTERS] libpqtypes - libpqtypes: Updated groff2html, fixed some man links

Log Message:
-----------
Updated groff2html, fixed some man links

Modified Files:
--------------
libpqtypes:
groff2html (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/groff2html.diff?r1=1.2&r2=1.3)
libpqtypes/docs/man3:
PQparamExec.3 (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/libpqtypes/libpqtypes/docs/man3/PQparamExec.3.diff?r1=1.2&r2=1.3)

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

[BUGS] ORDER BY...LIMIT optimization does not work with inherited tables

PostgreSQL 8.3 added a new optimization to avoid sorting in queries that
use ORDER BY ... LIMIT. This optimization does not work when the query
is issued to a parent table with several children, such as a partitioned
table.

PostgreSQL version: 8.3.1
Operating System: RedHat Enterprise Linux 4

The attached example shows a query to a single table that uses the ORDER
BY ... LIMIT optimization. Then it shows that the query does not
optimize (uses sort) when executed to the parent of that table. Execute
as a user that can create databases as "psql -f
order_by_limit_partition_test.sql postgres". It creates a database
called test_order_by_limit_db.

Re: [GENERAL] Import German Decimal Numbers

am Wed, dem 07.05.2008, um 14:25:13 +0200 mailte Jan Christian Dittmer folgendes:
> Hi!
>
> I want to import some data from an ascii file using the COPY sql-command.
> Unfortunatly the decimal numbers are given in german format, meaning the
> decimal point is replaced by a comma (, instead of .). Is there any
> possiblility
> to switch the clients behaviourr (like 'set datestyle') for
> interpretation of decimals?

Don't know, but you can replace the , to . within the ascii-file (sed,
awk, ...).


Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA

http://wwwkeys.de.pgp.net

--
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] bytea and character encoding when inserting escaped literals

On 05/05/2008 16:07, Lee Feigenbaum wrote:

> INSERT INTO myTable VALUES (..., E'\x15\x1C\x2F\x00\x02...', ...) ;

As I understand it, the octets need to be entered as their octal
representation - have a look at table 8-7 at

http://www.postgresql.org/docs/8.3/static/datatype-binary.html.

HTH,

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

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

[JDBC] German translation fixes

Here is an updated de.po based on the latest version in CVS with some spelling
fixes.

[GENERAL] Import German Decimal Numbers

Hi!

I want to import some data from an ascii file using the COPY sql-command.
Unfortunatly the decimal numbers are given in german format, meaning the
decimal point is replaced by a comma (, instead of .). Is there any
possiblility
to switch the clients behaviourr (like 'set datestyle') for
interpretation of decimals?

Thanks!

best regards,
Christian Dittmer

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

[JDBC] insufficient data left in message II

now i am able to reproduce this error.

the error occurs  if you set a (nullable) parameter in a prepared statement to null the "wrong way".
here are 4 examples and what happens

***
PreparedStatement stmt ...;

stmt.setObject(3,new Date(1000));       // no error
stmt.setObject(3,(java.sql.Date)null);    // no error
stmt.setDate(3,(java.sql.Date)null);      // -> ERROR: insufficient data left in message
stmt.setNull(3,java.sql.Types.DATE);     // -> ERROR: insufficient data left in message

***

really surprising to me is that it seems impossible to set NULL values via "setDate" and even more
surprising is that "setNull(...)" using the correct datatype does not work. i dont think that this is the
expected behavior and the error message is misleading too.

another interesteing behaviour is that, if you get this error you will also get this error running
the correct statement. but after calling the correct statement a few times the error message will disappear.

regards sepp






Wann haben Sie das letzte Mal Ihre Freunde oder Familie gesehen? Unlimitierte Videotelefonate mit dem Windows Live Messenger. Hier klicken!

 


Wann haben Sie das letzte Mal Ihre Freunde oder Familie gesehen? Unlimitierte Videotelefonate mit dem Windows Live Messenger. Hier klicken!

[BUGS] BUG #4148: tsearch related issue

The following bug has been logged online:

Bug reference: 4148
Logged by:
Email address: dksingh.engineer@gmail.com
PostgreSQL version: 8.3
Operating system: windows xp
Description: tsearch related issue
Details:

Hi,
I'm using tsearch in my application.
for query SELECT to_tsvector('surprise') it's showing result as 'surpris':1
but when I try to search this word its returning false.

SELECT to_tsvector('surprise') @@ to_tsquery('surpris');

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