Re: [GENERAL] PostgreSQL vs Mongo

2013-10-17 Thread Bill Moran
If they pull out the "Mongo is faster than PostgreSQL" card, I'll state that I investigated this for my current employer and with roughly equivalent configurations (because it's impossible to get exactly equivalent) I was getting roughly the same performance from each. It's difficult to measure e

Re: [GENERAL] PostgreSQL vs Mongo

2013-10-17 Thread Serge Fonville
One of the strengths/weaknesses of Mongo are with the similarity between code and access. This simplifies development from a developer's perspective, but complicates from an administrator perspective. If you want an informed opinion, ask the same question on the Mongo mailing list. Also look into f

Re: [GENERAL] pg_similarity

2013-10-17 Thread sachin kotwal
I tried the installation as suggested at http://pgsimilarity.projects.pgfoundry.org/ after make install command we have run following command:- psql -f SHAREDIR/contrib/pg_similarity.sql mydb Here SHAREDIR is /usr/local/pgsql/share/extension/ under this directory we can see file pg_similarity.s

Re: [GENERAL] C-language stored function and float4 type

2013-10-17 Thread sachin kotwal
How you checked result type? Can you explain in details? - Thanks and Regards, Sachin Kotwal NTT-DATA-OSS Center (Pune) -- View this message in context: http://postgresql.1045698.n5.nabble.com/C-language-stored-function-and-float4-type-tp5773493p5774840.html Sent from the PostgreSQL - gene

[GENERAL] Index creation fails with automatic names

2013-10-17 Thread Florian Nigsch
Hi all, I am not sure if this is a bug or a misuse on my part. I am creating a number of indices in parallel on a table by using xargs. To do that, I write all my indices in a file indices.idx, and then have the indices build in parallel (in this case with 5 concurrent processes) cat ind

[GENERAL] Idle transactions in PostgreSQL 9.2.4

2013-10-17 Thread Svetlin Manavski
Hi all, I have some idle transactions in PostgreSQL 9.2.4 server which never end. My application was working fine on version 9.1 (BSD) but the problem appeared immediately as we ported it to 9.2.4 on Linux. The idle operations would frequently appear as COMMITs but sometimes I observed INSERTS as

[GENERAL] Remove or alter the default access privileges of the public schema by the database owner

2013-10-17 Thread Christian Affolter
Hi everyone I'm looking for a way to let a role which created a new database (is the database owner) change (remove) the default access privileges of the public schema, which allows everyone to use and create objects within this schema. I do not want to give the role the SUPERUSER option.

[GENERAL] Help function to sort string

2013-10-17 Thread ginkgo36
Hi everyone, Please hepl me this function: 1. I want to sort string follow anphabet and I used this query: select string_agg(x, ';') from (select trim(unnest(regexp_split_to_array('ECD FORM; BODY; PREDILUTED; CHROMO-GENIC; AUTO;RABBIT; FORMAT',';'))) x order by x) a; -- result: AUTO; BODY; CHROMO

Re: [GENERAL] C-language stored function and float4 type

2013-10-17 Thread whiplash
Sorry, I created an overloaded function and forgot about it. whiplash writes: Hello! I have C-language stored function like this: CREATE FUNCTION testfunc ( x real, y real ) RETURNS real AS 'testfunc' LANGUAGE C STRICT; If i use this function (SELECT testfunc ( 0.1, 0.2 )) I get result with typ

[GENERAL] Missing record in binary replica 9.3.0

2013-10-17 Thread Kaveh Mousavi Zamani
All, I found something in the following setup: I have 3 DBS db01 (9.3.0) master db02 (9.3.0) replica same network db03 (9.3.0) sync replica another network 80ms away. db01 have around 30 - 300 records per second update. At some point today I found there is a missing record in both replica. Dat

Re: [GENERAL] Index creation fails with automatic names

2013-10-17 Thread Vick Khera
On Mon, Oct 14, 2013 at 6:31 AM, Florian Nigsch wrote: > My question is then - where does this error come from? Is is because > Postgres allocates the same name (table1_lower_idx) twice when the index > begins building, because at that time there's no index present with that > name? But if one in

Re: [GENERAL] Index creation fails with automatic names

2013-10-17 Thread Ian Lawrence Barwick
2013/10/14 Florian Nigsch : > Hi all, > > I am not sure if this is a bug or a misuse on my part. > > I am creating a number of indices in parallel on a table by using xargs. To > do that, I write all my indices in a file indices.idx, and then have the > indices build in parallel (in this case with

[GENERAL] Missing record in binary replica 9.3.0

2013-10-17 Thread Kaveh Mousavi Zamani
All, I found something in the following setup: I have 3 DBS db01 (9.3.0) master db02 (9.3.0) replica same network db03 (9.3.0) sync replica another network 80ms away. db01 have around 30 - 300 records per second update. At some point today I found there is a missing record in both replica. Dat

Re: [GENERAL] Remove or alter the default access privileges of the public schema by the database owner

2013-10-17 Thread Christian Affolter
Hello Please accept my apologies for the double posting. The original mail was held off by the Majordomo mailing list software until a mailing list administrator would allow it to be delivered. Majordomo doesn't like the string 'remove' within the subject. Thereupon, I informed the mailing lis

Re: [GENERAL] Index creation fails with automatic names

2013-10-17 Thread Merlin Moncure
On Mon, Oct 14, 2013 at 5:31 AM, Florian Nigsch wrote: > Hi all, > > I am not sure if this is a bug or a misuse on my part. > > I am creating a number of indices in parallel on a table by using xargs. To > do that, I write all my indices in a file indices.idx, and then have the > indices build in

[GENERAL] COPY table FROM STDIN doesn't show count tag

2013-10-17 Thread Tim Kane
According to the docs, the output of a copy command should return a COPY count. It turns out this only happens when copying from a file, and not from STDIN. > Outputs > On successful completion, a COPY command returns a command tag of the form > COPY count > The count is the number of rows copie

Re: [GENERAL] Idle transactions in PostgreSQL 9.2.4

2013-10-17 Thread Victor Yegorov
2013/10/15 Svetlin Manavski > I have some idle transactions in PostgreSQL 9.2.4 server which never end. > My application was working fine on version 9.1 (BSD) but the problem > appeared immediately as we ported it to 9.2.4 on Linux. The idle operations > would frequently appear as COMMITs but som

[GENERAL] Strange results with pg_restore

2013-10-17 Thread Oscar Calderon
Have a good day. This friday i'm going to migrate an entire database of a government institution in my country. Those are like 4 database of 2GB each one. So, i was preparing about what i'm going to do tomorrow. They currently have PostgreSQL 9.1 installed from source i think, and they will update

[GENERAL] day_trunc and day duration in a remote time zone

2013-10-17 Thread Marc Mamin
Hello, I want to retrieve the day start and duration of an epoch within a given time zone and return the day start as epoch. the queries below works as expected, but I would appreciate a simpler solution ... example: ( http://localtimes.info/Europe/Cyprus/Nicosia/ ) select (

Re: [GENERAL] day_trunc and day duration in a remote time zone

2013-10-17 Thread Adrian Klaver
On 10/17/2013 08:47 AM, Marc Mamin wrote: Hello, I want to retrieve the day start and duration of an epoch within a given time zone and return the day start as epoch. Not quite sure what you are looking for, but something like: hplc=> select current_date::timestamp, extract(epoch from curre

Re: [GENERAL] PostgreSQL vs Mongo

2013-10-17 Thread David Kerr
On Wed, Oct 16, 2013 at 09:30:59AM -0600, CS DBA wrote: - All; - - One of our clients is talking about moving to Mongo for their - reporting/data mart. I suspect the real issue is the architecture of - their data mart schema, however I don't want to start pushing back if I - can't back it up.

Re: [GENERAL] Index creation fails with automatic names

2013-10-17 Thread Kevin Grittner
Merlin Moncure wrote: > On Mon, Oct 14, 2013 at 5:31 AM, Florian Nigsch wrote: >> I am creating a number of indices in parallel on a table by using xargs. To >> do that, I write all my indices in a file indices.idx, and then have the >> indices build in parallel (in this case with 5 concurrent

Re: [GENERAL] Index creation fails with automatic names

2013-10-17 Thread Kevin Grittner
Ian Lawrence Barwick wrote: > It works fine for me on Pg 9.3.1: > > postgres=# CREATE TABLE foo(val1 text, val2 text); > CREATE TABLE > postgres=# CREATE INDEX on foo((lower(val1))); > CREATE INDEX > postgres=# CREATE INDEX on foo((lower(val2))); > CREATE INDEX You seem to be creating the indexe

[GENERAL] when do I analyze after concurrent index creation?

2013-10-17 Thread AI Rumman
Hi, I have a very basic question. If I create index concurrently, then do I need to analyze the table? If yes, when? Please let me know. Thanks.

Re: [GENERAL] Need some help on Performance 9.0.4

2013-10-17 Thread Tomas Vondra
On 17.10.2013 20:56, akp geek wrote: > got the output from depesz and this the top on the system. thanks for > the help .. >From depesz? That site works differently - you enter the explain plan into the form, it does some formatting/highlighting and you're supposed to submit the link to that pag

[GENERAL] How do I create a box from fields in a table?

2013-10-17 Thread Rob Richardson
I need to determine whether a given pair of coordinates is inside a given rectangle. According to the documentation, PostgreSQL provides the box and point types and a "contains" operator that will be perfect for this. However, the example provided in the documentation only shows the creation o

Re: [GENERAL] How do I create a box from fields in a table?

2013-10-17 Thread Merlin Moncure
On Thu, Oct 17, 2013 at 4:04 PM, Rob Richardson wrote: > I need to determine whether a given pair of coordinates is inside a given > rectangle. According to the documentation, PostgreSQL provides the box and > point types and a "contains" operator that will be perfect for this. > However, the

[GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Huang, Suya
Hi, I've got a question of converting database from ascii to UTF-8, what's the best approach to do so if the database size is very large? Detailed procedure or experience sharing are much appreciated! Thanks, Suya

Re: [GENERAL] werid error"index row size 3040 exceeds btree maximum, 2712" occur randomly

2013-10-17 Thread Huang, Suya
Thanks Tomas! I'll spend some time on the link you sent, new learner of Postgres :-) Thanks, Suya -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tomas Vondra Sent: Wednesday, October 16, 2013 9:06 AM To: pgsql-general

Re: [GENERAL] Index creation fails with automatic names

2013-10-17 Thread Ian Lawrence Barwick
2013/10/18 Kevin Grittner : > Ian Lawrence Barwick wrote: > >> It works fine for me on Pg 9.3.1: >> >> postgres=# CREATE TABLE foo(val1 text, val2 text); >> CREATE TABLE >> postgres=# CREATE INDEX on foo((lower(val1))); >> CREATE INDEX >> postgres=# CREATE INDEX on foo((lower(val2))); >> CREATE IN

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Steve Atkins
On Oct 17, 2013, at 3:13 PM, "Huang, Suya" wrote: > Hi, > > I’ve got a question of converting database from ascii to UTF-8, what’s the > best approach to do so if the database size is very large? Detailed procedure > or experience sharing are much appreciated! > The answer to that depends

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread John R Pierce
On 10/17/2013 3:13 PM, Huang, Suya wrote: I’ve got a question of converting database from ascii to UTF-8, what’s the best approach to do so if the database size is very large? Detailed procedure or experience sharing are much appreciated! I believe you will need to dump the whole database, an

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Huang, Suya
Thanks Steve, Yes, we're using SQL_ASCII. Would you please be more specific about manual data cleanup work here? I'm new to Postgres and don't have any experience in character set conversion before, so any specific experience shared would be very much appreciated. Thanks, Suya -Original

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Adrian Klaver
On 10/17/2013 08:51 PM, Huang, Suya wrote: Thanks Steve, Yes, we're using SQL_ASCII. Would you please be more specific about manual data cleanup work here? I'm new to Postgres and don't have any experience in character set conversion before, so any specific experience shared would be very mu

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Huang, Suya
Forgot to mention, we're using a very old version which is 8.3.11. I'll take a look at the guide for 8.3 with similar section. Thanks Adrian! -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Friday, October 18, 2013 3:05 PM To: Huang, Suya; Steve Atkins; pg

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Huang, Suya
Yes John, we probably will use a new database server here to accommodate those converted database. By saying export/import, do you mean by : 1. pg_dump (//should I specify -E UTF 8 to dump the data in UTF-8 encoding?) 2. create database xxx -E UTF8 3. pg_restore I also see someone's doing this

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread John R Pierce
On 10/17/2013 9:49 PM, Huang, Suya wrote: Yes John, we probably will use a new database server here to accommodate those converted database. By saying export/import, do you mean by : 1. pg_dump (//should I specify -E UTF 8 to dump the data in UTF-8 encoding?) 2. create database xxx -E UTF8 3.

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread Huang, Suya
Hi John, " Is it UTF8 data stored in SQL_ASCII or is it LATIN1 (ISO-8859) ? or some sort of Big5 or euc_cn ? or what? if it is already UTF8 data, are you sure that there are no invalid encodings accidentally stored? Postgres with SQL_ASCII does no character validation... if its all USASCI

Re: [GENERAL] [ADMIN] what's the efficient/safest way to convert database character set ?

2013-10-17 Thread John R Pierce
On 10/17/2013 10:51 PM, Huang, Suya wrote: Question: How can I pull out the real character set information from the database? does it rely on the understanding of business knowledge? what did you store in it? because its declared SQL_ASCII, postgres doesn't know, its all just bytes. you