Re: [GENERAL] inserting huge file into bytea cause out of memory

2013-08-07 Thread Albe Laurenz
liuyuanyuan wrote: By the way, my project is about migrating Oracle data of BLOB type to PostgreSQL database. The out of memory error occurred between migrating Oracle BLOB to PostgreSQL bytea. Another question, if I can't migrate BLOB to bytea, how about oid type ? Large Objects (I guess

Re: [GENERAL] inserting huge file into bytea cause out of memory

2013-08-07 Thread Michael Paquier
On Wed, Aug 7, 2013 at 3:56 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: liuyuanyuan wrote: By the way, my project is about migrating Oracle data of BLOB type to PostgreSQL database. The out of memory error occurred between migrating Oracle BLOB to PostgreSQL bytea. Another question, if I

[GENERAL] Replication Postgre Oracle

2013-08-07 Thread BOUVARD Aurélien
Hi all, My compagny would like to configure replication between PostgreSQL 9.2.4 and Oracle Database (11g and maybe 12c soon). We saw that Postgres Plus Database Replication could be a good solution for us. We also thank to develop a solution based on trigger and/or WAL , but we didn't know

Re: [GENERAL] Staging Database

2013-08-07 Thread Luca Ferrari
On Wed, Aug 7, 2013 at 6:00 AM, BladeOfLight16 bladeofligh...@gmail.com wrote: The company I work for has a client who has expressed interest in having a staging database for their data. Staging as in they add data, do some QCing, then push to a database with an identical schema to make it

Re: [GENERAL] Replication Postgre Oracle

2013-08-07 Thread Gavin Flower
On 07/08/13 20:24, BOUVARD Aurélien wrote: Hi all, My compagny would like to configure replication between PostgreSQL 9.2.4 and Oracle Database (11g and maybe 12c soon). We saw that/Postgres Plus Database Replication /could be a good solution for us.// // We also thank to develop a

Re: [GENERAL] Replication Postgre Oracle

2013-08-07 Thread James Sewell
Postgres Plus Advanced Server (PPAS) is a licensed version of PostgreSQL owned by EnterpriseDB. You need to buy a support contract to use this software (although there is a 45 day trial period). The component you are talking about is xDB Replication Server, which is part of the PPAS product or

[GENERAL] How to avoid Force Autovacuum

2013-08-07 Thread Vishalakshi Navaneethakrishnan
Hi All, We have one production database server , having 6 DBs, Postgres 9.2.1 version. This is my vacuum settings in Production database #autovacuum = on# Enable autovacuum subprocess? 'on' # requires track_counts to also be on.

Re: [GENERAL] Hierarchical numeric data type

2013-08-07 Thread Chris Travers
This depends on exactly what you need. In the end usually you are going to want to convert things into integer arrays. In LedgerSMB we use integers and foreign keys to handle hierarchies, and then convert them to int arrays via WITH RECURSIVE CTE's and text strings . This is one of those things

[GENERAL] Populating array of composite datatype

2013-08-07 Thread Sameer Thakur
Hello, I have a composite datatype abc which has two integer fields x,y. I have a table Test which has an array of abc. I am trying to populate Test. Tried insert into test values (ARRAY[abc(1,2)]); but got error ERROR: function abc(integer, integer) does not exist Is there anyway for doing

Re: [GENERAL] Staging Database

2013-08-07 Thread BladeOfLight16
On Wed, Aug 7, 2013 at 4:43 AM, Luca Ferrari fluca1...@infinito.it wrote: Not really helpful, but here are my considerations. The low frequency and the preference for a single server suggest me a dump and restore cycle on two databases, assuming this is possible due to not high volume data.

Re: [GENERAL] Populating array of composite datatype

2013-08-07 Thread Raghavendra
On Wed, Aug 7, 2013 at 4:04 PM, Sameer Thakur samthaku...@gmail.com wrote: Hello, I have a composite datatype abc which has two integer fields x,y. I have a table Test which has an array of abc. I am trying to populate Test. Tried insert into test values (ARRAY[abc(1,2)]); but got error

Re: [GENERAL] Populating array of composite datatype

2013-08-07 Thread Chris Travers
On Wed, Aug 7, 2013 at 3:53 AM, Raghavendra raghavendra@enterprisedb.com wrote: postgres=# insert into foo values (array[row(1,2)::abc]); Also because all array members must be of the same db type, you can: insert into foo values (array[row(1,2)]::abc[]). This can be helpful if you

Re: [GENERAL] Populating array of composite datatype

2013-08-07 Thread Raghavendra
On Wed, Aug 7, 2013 at 3:53 AM, Raghavendra raghavendra@enterprisedb.com wrote: postgres=# insert into foo values (array[row(1,2)::abc]); Also because all array members must be of the same db type, you can: insert into foo values (array[row(1,2)]::abc[]). This can be helpful if

Re: [GENERAL] Populating array of composite datatype

2013-08-07 Thread Sameer Thakur
Thank you Raghavendra and Chris, both approaches work.

[GENERAL] Self referencing composite datatype

2013-08-07 Thread Sameer Thakur
Hello, I wanted to create a composite datatype to represent a Node. So it would have a few attributes and an array of type Node which is the children of this node. create type Node as (r integer, s integer, children Node []); But i get error type Node[] does not exist. I understand that Node is

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread Chris Travers
On Wed, Aug 7, 2013 at 4:57 AM, Sameer Thakur samthaku...@gmail.com wrote: Hello, I wanted to create a composite datatype to represent a Node. So it would have a few attributes and an array of type Node which is the children of this node. create type Node as (r integer, s integer, children

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread David Johnston
Sameer Thakur wrote Hello, I wanted to create a composite datatype to represent a Node. So it would have a few attributes and an array of type Node which is the children of this node. create type Node as (r integer, s integer, children Node []); But i get error type Node[] does not exist. I

[GENERAL] Pl/Python runtime overhead

2013-08-07 Thread Seref Arikan
Greetings, Somehow I have failed to find the appropriate keywords for successful results for my question. When a pl/python based function is invoked, does it keep a python runtime running across calls to same function? That is, if I use connection pooling, can I save on the python runtime

Re: [GENERAL] Populating array of composite datatype

2013-08-07 Thread David Johnston
Sameer Thakur wrote insert into test values (ARRAY[abc(1,2)]); but got error When you use a function form of casting like this you are basically short-circuiting the type conversion mechanisms built into PostgreSQL by directly calling the conversion function instead of actually telling the

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of David Johnston Sent: Wednesday, August 07, 2013 10:35 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Self referencing composite datatype Sameer Thakur

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread David Johnston
Igor Neyman wrote create type node as (r integer, s integer); alter type node add attribute children node[]; Under 9.2.2 I'm getting an error: ERROR: composite type node cannot be made a member of itself I'm not sure why the limitation exists (probably something to do with avoiding

[GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread Eliseo Viola
Hello. I have been reading the -http://opensource.org/licenses/postgresql- to know if i can use PostgreSQL in a Privative Closed Commercial Software (The worst of the worst :P ). in the company where i work. Is there any restriction or limit to do it.?

Re: [GENERAL] Staging Database

2013-08-07 Thread David Johnston
BladeOfLight16 wrote The company I work for has a client who has expressed interest in having a staging database for their data. Staging as in they add data, do some QCing, then push to a database with an identical schema to make it public. Fortunately, we're not doing that right now, but it's

Re: [GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread David Johnston
I am not a lawyer and cannot evaluate your risk profile and usage but: Simply connecting to, creating objects, and running queries against PostgreSQL does not encumber your external application at all. The database schema you create (the objects inside the database) is not affected. Deploying

Re: [GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread Adrian Klaver
On 08/07/2013 08:23 AM, Eliseo Viola wrote: Hello. I have been reading the -http://opensource.org/licenses/postgresql- to know if i can use PostgreSQL in a Privative Closed Commercial Software (The worst of the worst :P ). in the company where i work. Is there any restriction or limit to do it.?

Re: [GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread Peter Geoghegan
On Wed, Aug 7, 2013 at 8:23 AM, Eliseo Viola eliseo.vi...@vodemia.com wrote: I have been reading the -http://opensource.org/licenses/postgresql- to know if i can use PostgreSQL in a Privative Closed Commercial Software (The worst of the worst :P ). in the company where i work. Is there any

[GENERAL] How to prevent clear screen when query finish ?

2013-08-07 Thread Condor
Hello, sorry for dumb question, did any one can tell me how the hell I can remove clear screen after finish the sql query from console ? This probably have some idea, but for me look like very ... not good idea. When I run query from console like: SELECT * FROM table_x; I got the result ...

Re: [GENERAL] Staging Database

2013-08-07 Thread Steve Crawford
On 08/07/2013 03:38 AM, BladeOfLight16 wrote: On Wed, Aug 7, 2013 at 4:43 AM, Luca Ferrari fluca1...@infinito.it mailto:fluca1...@infinito.it wrote: ... I wasn't very careful with my wording. Sorry about that. There will be updates and possibly deletions as well as additions.

Re: [GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread Richard Broersma
On Wed, Aug 7, 2013 at 8:43 AM, David Johnston pol...@yahoo.com wrote: Where the PostgreSQL license comes into play is if you make alterations to the PostgreSQL database itself - the underlying engine implemented in C and to some degree the supporting utilities written in various languages.

Re: [GENERAL] How to prevent clear screen when query finish ?

2013-08-07 Thread Adrian Klaver
On 08/07/2013 08:53 AM, Condor wrote: Hello, sorry for dumb question, did any one can tell me how the hell I can remove clear screen after finish the sql query from console ? This probably have some idea, but for me look like very ... not good idea. When I run query from console like: SELECT *

Re: [GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread Steve Atkins
On Aug 7, 2013, at 8:23 AM, Eliseo Viola eliseo.vi...@vodemia.com wrote: Hello. I have been reading the -http://opensource.org/licenses/postgresql- to know if i can use PostgreSQL in a Privative Closed Commercial Software (The worst of the worst :P ). in the company where i work. Is

Re: [GENERAL] Populating array of composite datatype

2013-08-07 Thread John McKown
Just wanted to put a short thank you note in here. I've been using PostgreSQL for a while, but only using basic SQL. The information in this thread pointed me to the information that I needed to read about to solve a problem which has been tormenting me, off and on, for a couple of months. I just

Re: [GENERAL] PostrgreSQL Commercial restrictions?

2013-08-07 Thread Stephen Frost
Richard, * Richard Broersma (richard.broer...@gmail.com) wrote: On Wed, Aug 7, 2013 at 8:43 AM, David Johnston pol...@yahoo.com wrote: Where the PostgreSQL license comes into play is if you make alterations to the PostgreSQL database itself - the underlying engine implemented in C and to

Re: [GENERAL] [tsearch2] Problem with case sensitivity (or with creating own dictionary)

2013-08-07 Thread Krzysztof xaru Rajda
Ok, so to be sure if I understand everything - first I should install a postgresql-contrib extension. Next, there will appear a contrib/dict_int directory with dict_int sourcecode inside, which I can modify. Then, I'll be able to install this modified dictionary, and it would be working

[GENERAL] Adding ip4r to Postgresql core?

2013-08-07 Thread Joe Van Dyk
Hi, Any chance ip4r could be an official postgresql extension? It's got a lot of advantages over the existing cidr/inet stuff. https://github.com/RhodiumToad/ip4r-historical/blob/master/README.ip4r Joe

Re: [GENERAL] Exit code -1073741819

2013-08-07 Thread Carlos Henrique Reimer
Hi, Could finally fix it. Used the binary search approach to identify the wrong tuples and removed them by ctid, 9 rows were removed and all of them belonged to the same block. I believe it is not easy to identify the root cause for the corruption but does any one have some directions I could

Re: [GENERAL] Exit code -1073741819

2013-08-07 Thread Sergey Konoplev
On Wed, Aug 7, 2013 at 2:46 PM, Carlos Henrique Reimer carlos.rei...@opendb.com.br wrote: Could finally fix it. Used the binary search approach to identify the wrong tuples and removed them by ctid, 9 rows were removed and all of them belonged to the same block. It is good. I still highly

[GENERAL] Commit problem in read-commited isolation level

2013-08-07 Thread S H
Hi, I have faced very strange problem in one of psotgresql query in one of the production environment. It is working fine in development and other environment. Current value in colname = 5;Update tablename set colname = 0 where key = 18;commit , in parallel to above queries ( either vacuum or

Re: [GENERAL] Commit problem in read-commited isolation level

2013-08-07 Thread Adrian Klaver
On 08/07/2013 04:54 PM, S H wrote: Hi, I have faced very strange problem in one of psotgresql query in one of the production environment. It is working fine in development and other environment. Current value in colname = 5; Update tablename set colname = 0 where key = 18; commit , in parallel

Re: [GENERAL] How to avoid Force Autovacuum

2013-08-07 Thread Sergey Konoplev
On Wed, Aug 7, 2013 at 2:46 AM, Vishalakshi Navaneethakrishnan nvishalak...@sirahu.com wrote: Daily once we are executing Vacuum Freeze analyze -- To prevent transaction id wraparound using this command vacuumdb -F -z -h localhost -U postgres dbname It is not necessary to do. Autovacuum does

Re: [GENERAL] inserting huge file into bytea cause out of memory

2013-08-07 Thread liuyuanyuan
liuyuanyuan From: Michael Paquier Date: 2013-08-07 15:26 To: Albe Laurenz CC: liuyuanyuan; Chris Travers; tv; pgsql-general Subject: Re: [GENERAL] inserting huge file into bytea cause out of memory On Wed, Aug 7, 2013 at 3:56 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: liuyuanyuan

Re: [GENERAL] Pl/Python runtime overhead

2013-08-07 Thread Sergey Konoplev
On Wed, Aug 7, 2013 at 7:43 AM, Seref Arikan serefari...@kurumsalteknoloji.com wrote: When a pl/python based function is invoked, does it keep a python runtime running across calls to same function? That is, if I use connection pooling, can I save on the python runtime initialization and

[GENERAL] Performance of ORDER BY RANDOM to select random rows?

2013-08-07 Thread Victor Hooi
Hi, I have a Django application where we need to pull random rows out of a table. According to the Django documentation: https://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by Note: order_by('?') queries may be expensive and slow, depending on the database backend you’re using.

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread Sergey Konoplev
On Wed, Aug 7, 2013 at 4:57 AM, Sameer Thakur samthaku...@gmail.com wrote: I wanted to create a composite datatype to represent a Node. So it would have a few attributes and an array of type Node which is the children of this node. create type Node as (r integer, s integer, children Node []);

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread Sergey Konoplev
On Wed, Aug 7, 2013 at 7:11 PM, Sergey Konoplev gray...@gmail.com wrote: so you could download 9.3rc2 and experimant with it. Sorry, 9.3beta2 of course. -- Kind regards, Sergey Konoplev PostgreSQL Consultant and DBA http://www.linkedin.com/in/grayhemp +1 (415) 867-9984, +7 (901) 903-0499, +7

Re: [GENERAL] inserting huge file into bytea cause out of memory

2013-08-07 Thread Chris Travers
On Wed, Aug 7, 2013 at 6:41 PM, liuyuanyuan liuyuany...@highgo.com.cnwrote: ** Thanks for your last reply! I've test Large Object ( oid type ), and it seems better on out of memory. But, for the out of memory problem of bytea, we really have no idea to solve it ? Why

Re: [GENERAL] Adding ip4r to Postgresql core?

2013-08-07 Thread Tom Lane
Joe Van Dyk j...@tanga.com writes: Any chance ip4r could be an official postgresql extension? That's been proposed before, and rejected before, on the grounds that since it doesn't support IPv6 its days are numbered. That consideration isn't getting any weaker as time passes. If we accepted

Re: [GENERAL] Adding ip4r to Postgresql core?

2013-08-07 Thread Alvaro Herrera
Tom Lane wrote: Joe Van Dyk j...@tanga.com writes: Any chance ip4r could be an official postgresql extension? That's been proposed before, and rejected before, on the grounds that since it doesn't support IPv6 its days are numbered. Actually, that's not true. Quoting from the linked

Re: [GENERAL] How to avoid Force Autovacuum

2013-08-07 Thread Vishalakshi Navaneethakrishnan
Hi, vacuumdb -F -z -h localhost -U postgres dbname It is not necessary to do. Autovacuum does it itself where and when needed. If we did not do this, then autovacuum will occur, Load was very high at that time and the server was unresponsive, To avoid this we are executing vacuum freeze

Re: [GENERAL] Self referencing composite datatype

2013-08-07 Thread Sameer Thakur
On Wed, Aug 7, 2013 at 4:57 AM, Sameer Thakur samthaku...@gmail.comwrote: Hello, I wanted to create a composite datatype to represent a Node. So it would have a few attributes and an array of type Node which is the children of this node. create type Node as (r integer, s integer, children

Re: [GENERAL] Adding ip4r to Postgresql core?

2013-08-07 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: That's been proposed before, and rejected before, on the grounds that since it doesn't support IPv6 its days are numbered. Actually, that's not true. Ah, my information is obsolete. Quoting from the linked readme file, :

Re: [GENERAL] How to avoid Force Autovacuum

2013-08-07 Thread Sergey Konoplev
On Wed, Aug 7, 2013 at 9:32 PM, Vishalakshi Navaneethakrishnan nvishalak...@sirahu.com wrote: cat /etc/issue CentOS release 6.3 (Final) cat /proc/meminfo |grep Hugepagesize Hugepagesize: 2048 kB Please show what commands below print. cat /proc/meminfo | grep -i huge cat

Re: [GENERAL] How to avoid Force Autovacuum

2013-08-07 Thread Vishalakshi Navaneethakrishnan
cat /proc/meminfo | grep -i huge AnonHugePages: 31576064 kB HugePages_Total: 0 HugePages_Free:0 HugePages_Rsvd:0 HugePages_Surp:0 Hugepagesize: 2048 kB cat /sys/kernel/mm/redhat_transparent_hugepage/enabled [always] never cat