[GENERAL] Hard upgrade (everything)

2014-02-06 Thread Frank Broniewski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi list, I've asked this question already on the PostGIS list, but I think it might get great answers here too. I'm running two database cluster with PostGIS 1.5 and PostgreSQL 9.1 on FreeBSD 9.2-RELEASE-p3 and apparently my PostGIS and PostgreSQL are

Re: [GENERAL] Temporary table already exists

2014-02-06 Thread mephysto
Hi Adrian, it is not an artifact. This log comes from a multiplayer game, and this is an specific test to replicate the error. Practically, there are two users that execute the same operation, so you can see the simultaneous selects. My opinion was every session was isolated from others and tempor

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Vik Fearing
On 02/06/2014 04:16 AM, Michael Sacket wrote: > Often times I find it necessary to work with table rows in a specific, > generally user-supplied order. It could be anything really that > requires an ordering that can't come from a natural column. Most of > the time this involved manipulating a po

Re: [GENERAL] How to get rid of superfluous WAL segments?

2014-02-06 Thread Vik Fearing
On 02/06/2014 06:51 AM, Torsten Förtsch wrote: > On 06/02/14 06:46, Torsten Förtsch wrote: >> we decreased wal_keep_segments quite a lot. What is the supposed way to >> get rid of the now superfluous files in pg_xlog? > Nothing special. The database did it for me. It cleans up after a checkpoint.

Re: [GENERAL] Temporary table already exists

2014-02-06 Thread alexandros_e
@mephysto I think you are trying to solve the wrong type of problem. Creation of tables (temporary or not) are not supposed to run concurrently. So, this is not an issue of PostgreSQL but design. There are two ways to solve the problem. a) You could use the sessionID (provided The Glassfish server

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Rémi Cura
Hey, I don"t understand the difference between this ORDINALITY option and adding a "row_number() over()" in the SELECT. Thanks, Cheers, Remi-C 2014-02-06 Vik Fearing : > On 02/06/2014 04:16 AM, Michael Sacket wrote: > > Often times I find it necessary to work with table rows in a specific, >

Re: [GENERAL] Hard upgrade (everything)

2014-02-06 Thread alexandros_e
I would use normal pg_dump and pg_restore for the DBs and not utils/postgis_restore.pl. Also, AFTER I backup all databases and everything else, you could try to upgrade Postgis without upgrading PostgreSQL by buliding from source e.g. http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21Ubuntu1304s

Re: [GENERAL] Hard upgrade (everything)

2014-02-06 Thread Rémi Cura
On my private computer I upgraded first the postgres to 9.3, then upgraded postgis. Sadly according to http://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS , postgis 1.5 is not compatible with postgres 9.3. However POstgis 2.1 is compatible with you current postgres option. So as suggested

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Vik Fearing
On 02/06/2014 10:00 AM, Rémi Cura wrote: > Hey, > I don"t understand the difference between this ORDINALITY option and > adding a "row_number() over()" in the SELECT. WITH ORDINALITY will give you something to order by. You should never do "row_number() over ()" because that will give you potent

Re: [GENERAL] Temporary table already exists

2014-02-06 Thread mephysto
I don't need local sorting, I only had to retrieve some objects from db belongs to user. A this point is it better unlogged tables or postgres object arrays? Il 06/feb/2014 09:35 "alexandros_e [via PostgreSQL]" < ml-node+s1045698n5790806...@n5.nabble.com> ha scritto: > @mephysto I think you are t

Re: [GENERAL] client encoding that psql command sets

2014-02-06 Thread Adrian Klaver
On 02/05/2014 11:43 PM, 坂本 翼 wrote: Hi all, When I tried to psql command, I found that the result of command seems to be different from explanation of the manual. Please tell me which is correct performance, the result of command or the explanation of manual. I show the details as follows. [Eve

Re: [GENERAL] Temporary table already exists

2014-02-06 Thread Adrian Klaver
On 02/06/2014 12:09 AM, mephysto wrote: Hi Adrian, it is not an artifact. This log comes from a multiplayer game, and this is an specific test to replicate the error. Practically, there are two users that execute the same operation, so you can see the simultaneous selects. My opinion was every s

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Rémi Cura
Ok, thanks ^^ Cheers, Rémi-C 2014-02-06 Vik Fearing : > On 02/06/2014 10:00 AM, Rémi Cura wrote: > > Hey, > > I don"t understand the difference between this ORDINALITY option and > > adding a "row_number() over()" in the SELECT. > > WITH ORDINALITY will give you something to order by. You sho

[GENERAL] Offending My Tender Sensibilities -OR- OLTP on a Star Schema

2014-02-06 Thread Roy Anderson
We have an OLTP database and no data warehouse. We are currently planning out a build for a data warehouse however (possibly using Hadoop). "X" is recommending that we convert our current, normalized OLTP database into a flattened Star Schema. The primary rationale for this OLTP flattening is that

[GENERAL] Help with connection issue - started today

2014-02-06 Thread Edson Richter
Dear all, I need your advise. Found a tricky situation. Without any changes in the configuration files, a **local** connection to a local VPN IP address could not be established with the following error: 2014-02-05 09:12:21.111 - x - org.postgresql.util.PSQLException: ERROR: could not est

Re: [GENERAL] Offending My Tender Sensibilities -OR- OLTP on a Star Schema

2014-02-06 Thread Merlin Moncure
On Tue, Feb 4, 2014 at 10:06 PM, Roy Anderson wrote: > We have an OLTP database and no data warehouse. We are currently > planning out a build for a data warehouse however (possibly using > Hadoop). "X" is recommending that we convert our current, normalized > OLTP database into a flattened Star S

[GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread alexandros_e
I wanted to ask you the following question to all experts here. Let's say I have this table foo ID|G1|T1| 1|2|ABC| 1|2|ABCD| 1|2|DEF| 1|2|DEFG| SELECT * FROM foo GROUP BY ID,G1,T1 RETURNS exactly the same table. Is there a way in SQL or PostgreSQL in general to group by values than are not exa

Re: [GENERAL] Help with connection issue - started today

2014-02-06 Thread Merlin Moncure
On Wed, Feb 5, 2014 at 5:21 AM, Edson Richter wrote: > Dear all, I need your advise. Found a tricky situation. > > Without any changes in the configuration files, a **local** connection to a > local VPN IP address could not be established with the following error: > > 2014-02-05 09:12:21.111 - xxx

Re: [GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread Tom Lane
alexandros_e writes: > Is there a way in SQL or PostgreSQL in general to group by values than are > not exactly the same but are quite similar (like 'ABC' and 'ABCD') based on > some distance function (levenshtein for example) if the distance is within > some threshold (i.e., 1) Well, you can GRO

Re: [GENERAL] Help with connection issue - started today

2014-02-06 Thread Adrian Klaver
On 02/06/2014 07:29 AM, Merlin Moncure wrote: The log is telling you exactly what's happening. "pg_hba.conf" is a database firewall of sorts that manages whom is allowed to connect to the database and from where. Fixing this is a matter of adding a rule to that file. The file is internally we

Re: [GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread Alban Hertroys
On 6 February 2014 16:18, alexandros_e wrote: > Let's say I have this table foo > > ID|G1|T1| > 1|2|ABC| > 1|2|ABCD| > 1|2|DEF| > 1|2|DEFG| > > SELECT * FROM foo > GROUP BY ID,G1,T1 > Is there a way in SQL or PostgreSQL in general to group by values than are > not exactly the same but are quite s

Re: [GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread Sergey Konoplev
On Thu, Feb 6, 2014 at 7:41 AM, Alban Hertroys wrote: > On 6 February 2014 16:18, alexandros_e wrote: >> Is there a way in SQL or PostgreSQL in general to group by values than are >> not exactly the same but are quite similar (like 'ABC' and 'ABCD') based on >> some distance function (levenshtein

Re: [GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread Gauthier, Dave
What about a regexp match ? -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tom Lane Sent: Thursday, February 06, 2014 10:32 AM To: alexandros_e Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Postgresql GROUP BY

Re: [GENERAL] Help with connection issue - started today

2014-02-06 Thread Bret Stern
You checked pg_hba_conf for host 10.68.73.6? Is there a matching log entry for the rejection? On Wed, 2014-02-05 at 09:21 -0200, Edson Richter wrote: > Dear all, I need your advise. Found a tricky situation. > > Without any changes in the configuration files, a **local** connection > to a local

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Sergey Konoplev
On Wed, Feb 5, 2014 at 7:16 PM, Michael Sacket wrote: > Often times I find it necessary to work with table rows in a specific, > generally user-supplied order. It could be anything really that requires an > ordering that can't come from a natural column. Most of the time this > involved manipula

Re: [GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread alexandros_e
Conceptually, Tom (as always) is right. But Alban's hack help. DROP TABLE foo; CREATE TABLE IF NOT EXISTS foo(ID INTEGER,G1 INTEGER, T1 TEXT, ID2 SERIAL PRIMARY KEY); INSERT INTO foo(ID,G1,T1) VALUES(1,2,'ABC'); INSERT INTO foo(ID,G1,T1) VALUES(1,2,'ABCD'); INSERT INTO foo(ID,G1,T1) VALUES(1,2,'A

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Michael Sacket
On Feb 6, 2014, at 2:23 AM, Vik Fearing wrote: > On 02/06/2014 04:16 AM, Michael Sacket wrote: >> Often times I find it necessary to work with table rows in a specific, >> generally user-supplied order. It could be anything really that requires an >> ordering that can't come from a natural col

[GENERAL] subtracting from a date

2014-02-06 Thread Jay Vee
I have reviewed working with dates documentation but some things are not clear and I cannot get an example to work for what I need. I am passing a date into a stored function like '2013-04-01' The stored function accepts this string as a date type. Within the function, I need to: 1. subtract o

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Adrian Klaver
On 02/06/2014 09:25 AM, Jay Vee wrote: I have reviewed working with dates documentation but some things are not clear and I cannot get an example to work for what I need. I am passing a date into a stored function like '2013-04-01' The stored function accepts this string as a date type. Within

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Steve Crawford
On 02/06/2014 09:25 AM, Jay Vee wrote: I have reviewed working with dates documentation but some things are not clear and I cannot get an example to work for what I need. I am passing a date into a stored function like '2013-04-01' The stored function accepts this string as a date type. Withi

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Jay Vee
I tried that but get an error v_start_date date; v_minus_one_year date; I have v_start_date to start with and want to subtract one year and put into v_minus_one_year select v_start_date - interval '1 yr' as v_minus_one_year; --- I get: ERROR: query has no destination for result da

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Jerry Sievers
Jay Vee writes: > I tried that but get an error > ? ? v_start_date date; > ? ? v_minus_one_year date; > > I have v_start_date to start with and want to subtract one year and put into > v_minus_one_year > ?? > ? select v_start_date - interval '1 yr' as v_minus_one_year; sj$ cat q create or repl

Re: [GENERAL] Offending My Tender Sensibilities -OR- OLTP on a Star Schema

2014-02-06 Thread Scott Marlowe
On Thu, Feb 6, 2014 at 7:51 AM, Merlin Moncure wrote: > *) Do not consider any advice to implement exotic storage backend from > someone that has not previously implemented that same technology on a > similar scale on a previous project, ever. Data of large scale is > hard. Installing magical t

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Gavin Flower
On 07/02/14 05:43, Michael Sacket wrote: On Feb 6, 2014, at 2:23 AM, Vik Fearing wrote: On 02/06/2014 04:16 AM, Michael Sacket wrote: Often times I find it necessary to work with table rows in a specific, generally user-supplied order. It could be anything really that requires an ordering t

Re: [GENERAL] Ordering Results by a Supplied Order

2014-02-06 Thread Rob Sargent
On 02/06/2014 11:57 AM, Gavin Flower wrote: On 07/02/14 05:43, Michael Sacket wrote: On Feb 6, 2014, at 2:23 AM, Vik Fearing wrote: On 02/06/2014 04:16 AM, Michael Sacket wrote: Often times I find it necessary to work with table rows in a specific, generally user-supplied order. It could be

[GENERAL] NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints

2014-02-06 Thread Jeff Janes
I've been plagued several times by NOT DEFERRABLE constraints. Is there any good reason to define a constraint as NOT DEFERRABLE rather than DEFERRABLE INITIALLY IMMEDIATE? For example, is there performance penalty for PostgreSQL being prepared to defer a constraint even though it is not currentl

Re: [GENERAL] NOT DEFERRABLE vs. DEFERRABLE INITIALLY IMMEDIATE constraints

2014-02-06 Thread Tom Lane
Jeff Janes writes: > I've been plagued several times by NOT DEFERRABLE constraints. Is there > any good reason to define a constraint as NOT DEFERRABLE rather > than DEFERRABLE INITIALLY IMMEDIATE? For example, is there performance > penalty for PostgreSQL being prepared to defer a constraint ev

Re: [GENERAL] Offending My Tender Sensibilities -OR- OLTP on a Star Schema

2014-02-06 Thread Merlin Moncure
On Thu, Feb 6, 2014 at 12:44 PM, Scott Marlowe wrote: > On Thu, Feb 6, 2014 at 7:51 AM, Merlin Moncure wrote: > >> *) Do not consider any advice to implement exotic storage backend from >> someone that has not previously implemented that same technology on a >> similar scale on a previous project

Re: [GENERAL] Offending My Tender Sensibilities -OR- OLTP on a Star Schema

2014-02-06 Thread Neil Tiffin
On Feb 6, 2014, at 12:44 PM, Scott Marlowe wrote: > Merlin, this reminds me of the quote from Mencken: For every complex > problem there is an answer that is clear, simple, and wrong. Or as Niklaus Wirth said. ... complexity has and will maintain a strong fascination for many people. It is t

[GENERAL] Exclude pg_log directory when running pg_basebackup?

2014-02-06 Thread wd
I found there is no option to disable sync for pg_log in pg_basebackup, maybe there should be one option to disalbe it?

Re: [GENERAL] subtracting from a date

2014-02-06 Thread David Johnston
jvsrvcs wrote > I tried that but get an error > v_start_date date; > v_minus_one_year date; > > I have v_start_date to start with and want to subtract one year and put > into v_minus_one_year > > select v_start_date - interval '1 yr' as v_minus_one_year; > > > > --- I get: > > ERRO

Re: [GENERAL] Offending My Tender Sensibilities -OR- OLTP on a Star Schema

2014-02-06 Thread Andy Colson
On 2/4/2014 10:06 PM, Roy Anderson wrote: We have an OLTP database and no data warehouse. We are currently planning out a build for a data warehouse however (possibly using Hadoop). "X" is recommending that we convert our current, normalized OLTP database into a flattened Star Schema. The primar

Re: [GENERAL] Help with connection issue - started today

2014-02-06 Thread Edson Richter
Em 06/02/2014 14:25, Bret Stern escreveu: You checked pg_hba_conf for host 10.68.73.6? Is there a matching log entry for the rejection? Thanks for your effort, Bret! Problem already solved (I've posted the solution in the list past days). Problem was a "context.xml" with a wrong database server

Re: [GENERAL] client encoding that psql command sets

2014-02-06 Thread Tsubasa Sakamoto
> Not sure that it makes a difference but the docs say psql looks at > LC_CTYPE not LANG for Unix systems. You did not say what OS you are > working on though from the examples I am guessing some form of Unix. Thank you for the response. Sorry, I had not indicated OS information. OS information

[GENERAL] password-less access, without using pg_hba

2014-02-06 Thread Reece Hart
I'd like to provide public access, without a password, to a database hosted on Amazon RDS. I'm familiar with using pg_hba.conf to enable trust (no) authentication for a user. pg_hba.conf is not available to DBAs on RDS. Is there any other way to achieve password-less login in postgresql? I tried

Re: [GENERAL] password-less access, without using pg_hba

2014-02-06 Thread David Johnston
Reece Hart wrote > I'd like to provide public access, without a password, to a database > hosted > on Amazon RDS. > > I'm familiar with using pg_hba.conf to enable trust (no) authentication > for > a user. pg_hba.conf is not available to DBAs on RDS. > > Is there any other way to achieve password

Re: [GENERAL] password-less access, without using pg_hba

2014-02-06 Thread John R Pierce
On 2/6/2014 6:07 PM, Reece Hart wrote: I'd like to provide public access, without a password, to a database hosted on Amazon RDS. I'm familiar with using pg_hba.conf to enable trust (no) authentication for a user. pg_hba.conf is not available to DBAs on RDS. Is there any other way to achieve

Re: [GENERAL] password-less access, without using pg_hba

2014-02-06 Thread Reece Hart
On Thu, Feb 6, 2014 at 6:37 PM, David Johnston wrote: > Doubtful. > Yeah, that's what I had assumed too. The question is motivated entirely by what I think would make it easier for users. In principle it's not difficult to give people a password (as I do now), but in practice it's a barrier tha

[GENERAL] WAL archive on slave

2014-02-06 Thread James Sewell
Hello, My understanding is that WAL archiving can not be enabled on the slave in a streaming replication pair. If this is correct, is there a reason behind it? I can see logs showing up in pg_xlog, so could they not be archived? The reason I ask is if this happened it would allow the following w

Re: [GENERAL] password-less access, without using pg_hba

2014-02-06 Thread David Johnston
Reece Hart wrote > On Thu, Feb 6, 2014 at 6:37 PM, David Johnston < > polobo@ > > wrote: > >> Doubtful. >> > > Yeah, that's what I had assumed too. > > The question is motivated entirely by what I think would make it easier > for > users. In principle it's not difficult to give people a passwo

Re: [GENERAL] password-less access, without using pg_hba

2014-02-06 Thread Tatsuo Ishii
> On Thu, Feb 6, 2014 at 6:37 PM, David Johnston wrote: > >> Doubtful. >> > > Yeah, that's what I had assumed too. > > The question is motivated entirely by what I think would make it easier for > users. In principle it's not difficult to give people a password (as I do > now), but in practice