Re: [GENERAL] why autocommit mode is slow?

2011-04-07 Thread Scott Marlowe
On Thu, Apr 7, 2011 at 2:59 PM, Szymon Guz wrote: > Hi, > this is maybe a stupid question, but I don't know how to explain to my > coworkers why performing many inserts in autocommit mode is so much slower > than making all of them in one transaction. > Why is that so slow? The real issue is that

Re: [GENERAL] why autocommit mode is slow?

2011-04-07 Thread Craig Ringer
On 04/08/2011 04:59 AM, Szymon Guz wrote: Hi, this is maybe a stupid question, but I don't know how to explain to my coworkers why performing many inserts in autocommit mode is so much slower than making all of them in one transaction. Why is that so slow? Unless you have synchronous_commit di

Re: [GENERAL] PostgreSQL backend process high memory usage issue

2011-04-07 Thread Rob Sargent
On 04/07/2011 03:46 PM, John R Pierce wrote: On 04/07/11 1:42 PM, Shianmiin wrote: Since the connection pool will be used by all tenants, eventually each connection will hit all the tables/views. don't all connections in a given pool have to use the same user credentials? won't that be prob

Re: [GENERAL] why autocommit mode is slow?

2011-04-07 Thread Adrian Klaver
On Thursday, April 07, 2011 1:59:50 pm Szymon Guz wrote: > Hi, > this is maybe a stupid question, but I don't know how to explain to my > coworkers why performing many inserts in autocommit mode is so much slower > than making all of them in one transaction. > > Why is that so slow? Because autoc

Re: [GENERAL] PostgreSQL backend process high memory usage issue

2011-04-07 Thread John R Pierce
On 04/07/11 1:42 PM, Shianmiin wrote: Since the connection pool will be used by all tenants, eventually each connection will hit all the tables/views. don't all connections in a given pool have to use the same user credentials? won't that be problematic for this architecture? -- Sent v

Re: [GENERAL] PostgreSQL backend process high memory usage issue

2011-04-07 Thread Merlin Moncure
On Thu, Apr 7, 2011 at 3:42 PM, Shianmiin wrote: > Hi there, > > We are evaluating using PostgreSQL to implement a multitenant database, > Currently we are running some tests on single-database-multiple-schema model > (basically, all tenants have the same set of database objects under then own > s

[GENERAL] PostgreSQL backend process high memory usage issue

2011-04-07 Thread Shianmiin
Hi there, We are evaluating using PostgreSQL to implement a multitenant database, Currently we are running some tests on single-database-multiple-schema model (basically, all tenants have the same set of database objects under then own schema within the same database). The application will maintai

Re: [GENERAL] why autocommit mode is slow?

2011-04-07 Thread Dann Corbit
It has nothing to do with autocommit and everything to do with batching them together. For instance, if you run ten update queries in autocommit mode I would expect it to take exactly the same time as: Begin Exec Query1 Commit … Begin Exec Query10 Commit From: pgsql-general-ow...@postgresql.

[GENERAL] why autocommit mode is slow?

2011-04-07 Thread Szymon Guz
Hi, this is maybe a stupid question, but I don't know how to explain to my coworkers why performing many inserts in autocommit mode is so much slower than making all of them in one transaction. Why is that so slow? regards Szymon

Re: [GENERAL] What happened to ALTER SCHEMA ... SET TABLESPACE?

2011-04-07 Thread Yang Zhang
Also, in PG8.4+, is there any way to set the default tablespace on a per-schema basis? On Thu, Apr 7, 2011 at 12:27 PM, Yang Zhang wrote: > Last I could find on this, it was slated for 8.1 inclusion: > > http://archives.postgresql.org/pgsql-patches/2004-08/msg00425.php > > But it doesn't seem to

[GENERAL] What happened to ALTER SCHEMA ... SET TABLESPACE?

2011-04-07 Thread Yang Zhang
Last I could find on this, it was slated for 8.1 inclusion: http://archives.postgresql.org/pgsql-patches/2004-08/msg00425.php But it doesn't seem to be there in my PG8.4 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.po

Re: [GENERAL] Understanding "unknown" data type

2011-04-07 Thread Tom Lane
Steve Crawford writes: > On 04/07/2011 11:29 AM, Tom Lane wrote: >> Steve Crawford writes: >>> 1. Where can I read up on the purpose and properties of a data-type of >>> unknown? >> It's the type initially imputed to unadorned string literals and NULL... > Is there a place in the documentation

Re: [GENERAL] Understanding "unknown" data type

2011-04-07 Thread Steve Crawford
Thanks Tom. On 04/07/2011 11:29 AM, Tom Lane wrote: Steve Crawford writes: 1. Where can I read up on the purpose and properties of a data-type of unknown? It's the type initially imputed to unadorned string literals and NULL... Is there a place in the documentation that explains this? I haven

Re: [GENERAL] Understanding "unknown" data type

2011-04-07 Thread Tom Lane
Steve Crawford writes: > 1. Where can I read up on the purpose and properties of a data-type of > unknown? It's the type initially imputed to unadorned string literals and NULL constants. The parser normally converts these to constants of some other type, as soon as it can figure out what type

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
> > >> and, FWIW, here's another trace, which is NEARLY the same as the first one I posted, with the difference being a slightly different line number at #3. I will be quiet now and leave the brain trust to ponder. Let me know if there is anything else I can get for you guys. #0 0x006ce

[GENERAL] Understanding "unknown" data type

2011-04-07 Thread Steve Crawford
I was working on a test restore and got: WARNING: column "astring" has type "unknown" The restore worked correctly - it was a warning not an error - and we located the cause and corrected it. But I did some playing leading to questions for which I have been unable to locate answers: steve=#

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
On Thu, Apr 7, 2011 at 10:45 AM, Tom Lane wrote: > Chris Curvey writes: > > And voila! Here is the backtrace: > > > #0 0x006ce317 in GetMemoryChunkSpace (pointer=0x347cc70) at > > mcxt.c:264 > > #1 0x006d3d56 in writetup_index (state=0x26fc530, tapenum= > optimized out>, stup=

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Scott Marlowe
On Thu, Apr 7, 2011 at 6:46 AM, Michael Gould wrote: > We want to protect the intellectual property of several of our stored > procedures.  If we put them in a separate schema in the database and only > allow execute on anything in that schema would that protect our stored > procedures? Just want

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Joshua D. Drake
On Thu, 2011-04-07 at 12:45 -0400, Andrew Sullivan wrote: > On Thu, Apr 07, 2011 at 09:31:20AM -0500, Michael Gould wrote: > > We wouldn't make any of the system users a superuser in Postgres and in my > > 20+ years experience in the industry we provide software for, the > > possibility of having a

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Andrew Sullivan
On Thu, Apr 07, 2011 at 09:31:20AM -0500, Michael Gould wrote: > We wouldn't make any of the system users a superuser in Postgres and in my > 20+ years experience in the industry we provide software for, the > possibility of having any users of the system that are able to hack or even > understand

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread John R Pierce
On 04/07/11 7:31 AM, Michael Gould wrote: We wouldn't make any of the system users a superuser in Postgres are you providing software run on a customers box, or a turnkey managed system (hardware+software) ? anyone who has root access can easily gain database access. anyone with physical

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Sim Zacks
On 04/07/2011 03:46 PM, Michael Gould wrote: We want to protect the intellectual property of several of our stored procedures. If we put them in a separate schema in the database and only allow execute on anything in that schema would that protect our stored procedures? Best Regards It dep

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Tom Lane
Chris Curvey writes: > And voila! Here is the backtrace: > #0 0x006ce317 in GetMemoryChunkSpace (pointer=0x347cc70) at > mcxt.c:264 > #1 0x006d3d56 in writetup_index (state=0x26fc530, tapenum= optimized out>, stup=) at tuplesort.c:2924 > #2 0x006d2af7 in dumptuples (st

Re: [GENERAL] Arrays of arrays

2011-04-07 Thread Radosław Smogura
Merlin Moncure Thursday 07 April 2011 15:53:00 > On Thu, Apr 7, 2011 at 4:39 AM, rsmogura wrote: > > Hello, > > > > May I ask if PostgreSQL supports arrays of arrays directly or indirectly, > > or if such support is planned? I'm interested about pseudo constructs > > like: 1. Directly - (integer

Re: [GENERAL] database backup throws errors

2011-04-07 Thread Tom Lane
"Michael Molz" writes: > we´re running PostgreSQL 8.4.7 for an CRM System on a Linux machine. > Database contains about 540 tables with summary about 2.5 million records. > Since this weeks the backup stops with an error message always at the same > table. It´s irrelevant what tool we use to

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Michael Gould
We wouldn't make any of the system users a superuser in Postgres and in my 20+ years experience in the industry we provide software for, the possibility of having any users of the system that are able to hack or even understand what they have if they were able to is slim. I understand that anythin

[GENERAL] database backup throws errors

2011-04-07 Thread Michael Molz
Hi folks, we´re running PostgreSQL 8.4.7 for an CRM System on a Linux machine. Database contains about 540 tables with summary about 2.5 million records. Since this weeks the backup stops with an error message always at the same table. It´s irrelevant what tool we use to backup (pgAdmin III,

Re: [GENERAL] Attaching/detaching tablespaces (or, in general, parts of a DB)

2011-04-07 Thread Vibhor Kumar
On Apr 7, 2011, at 7:35 AM, Yang Zhang wrote: > Is it possible to attach or detach parts of a DB (e.g. tablespaces), > such that I can flexibly move the disks containing the DB tables > around to different hosts? > > The last discussion I could find on this topic is from 2007, and the > answer w

Re: [GENERAL] Attaching/detaching tablespaces (or, in general, parts of a DB)

2011-04-07 Thread Guillaume Lelarge
Le 07/04/2011 04:05, Yang Zhang a écrit : > Is it possible to attach or detach parts of a DB (e.g. tablespaces), > such that I can flexibly move the disks containing the DB tables > around to different hosts? > No, you can't. But you actually don't need to. Users won't be able to access the objec

Re: [GENERAL] Arrays of arrays

2011-04-07 Thread Merlin Moncure
On Thu, Apr 7, 2011 at 4:39 AM, rsmogura wrote: > Hello, > > May I ask if PostgreSQL supports arrays of arrays directly or indirectly, or > if such support is planned? I'm interested about pseudo constructs like: > 1. Directly - (integer[4])[5] - this is equivalent to multidimensional > array, but

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Vibhor Kumar
On Apr 7, 2011, at 6:16 PM, Michael Gould wrote: > We want to protect the intellectual property of several of our stored > procedures. If we put them in a separate schema in the database and only > allow execute on anything in that schema would that protect our stored > procedures? If use is

Re: [GENERAL] Re: how to insert multiple rows and get the ids back in a temp table (pgplsql)?

2011-04-07 Thread Merlin Moncure
On Wed, Apr 6, 2011 at 11:12 PM, abhishek.itbhu2004 wrote: > I am still new to postgres. Can you please tell the exact syntax for this. I > tried different things but was not able to retun the ids of the newly > inserted rows. in 9.1 with wCTE you will have a very direct way to do this. in 9.0 do

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Andrew Sullivan
On Thu, Apr 07, 2011 at 07:46:36AM -0500, Michael Gould wrote: > We want to protect the intellectual property of several of our stored > procedures.  If we put them in a separate schema in the database and only > allow execute on anything in that schema would that protect our stored > procedures?

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Craig Ringer
On 04/07/2011 08:49 PM, Chris Curvey wrote: Let me see if I can load it somewhere else. And since the only other machine I have to try it on is a Windows box, I will be able to answer my own question of "are pg_dump dumps OS-portable?" The answer there is "mostly". Contrib modules can cause

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Szymon Guz
On 7 April 2011 14:46, Michael Gould wrote: > We want to protect the intellectual property of several of our stored > procedures. If we put them in a separate schema in the database and only > allow execute on anything in that schema would that protect our stored > procedures? > > > Protect them

[GENERAL] Protecting stored procedures

2011-04-07 Thread Michael Gould
We want to protect the intellectual property of several of our stored procedures.  If we put them in a separate schema in the database and only allow execute on anything in that schema would that protect our stored procedures?   Best Regards     -- Michael Gould, Managing Partner Intermod

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
> > > Are you able to distribute your dataset - if not to the general public, > then to someone interested in identifying the fault? > probably not. but let me ask...maybe I can come up with a creative solution. > Does the same dataset crash Pg when restored on another machine? That is a good

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Craig Ringer
On 04/07/2011 06:37 PM, Chris Curvey wrote: 2) install bison, flex and libreadline5-dev (sudo apt-get install PACKAGE). I already had the gcc package installed The easy way to do this on Debian/ubuntu, if you're building something that packages exist for, is (eg): sudo apt-get build-dep po

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
> > > Nor I. https://launchpad.net/~pitti/+archive/postgresql/+packages doesn't > seem to list any. > > Martin: Are your packages stripped, or do they include minimal debug info > in the main packages? Do you put your debuginfo debs anywhere accessible? > > I decided to just try building it myself

[GENERAL] Arrays of arrays

2011-04-07 Thread rsmogura
Hello, May I ask if PostgreSQL supports arrays of arrays directly or indirectly, or if such support is planned? I'm interested about pseudo constructs like: 1. Directly - (integer[4])[5] - this is equivalent to multidimensional array, but may be differently represented on protocol serializatio