[GENERAL] deadlock

2010-08-11 Thread John R Pierce
We've got an app, I don't know all the details of the schema offhand, but its using date partitioned tables, its heavily multithreaded and processing continuous events... Under load, production (overseas) is getting a SQL deadlock... Process 20333: DROP table data_details_20100718

Re: [GENERAL] InitDB: Bad system call

2010-08-11 Thread Torsten Zühlsdorff
Hi Tom, Bad system call (core dumped) Have you tried running the initdb with strace or truss? That might give you a clue as to exactly what system call is failing. Your jail isn't allowing something fundamental here, but it's hard to guess what. Or even easier, gdb the core file ...

Re: [GENERAL] pgtune

2010-08-11 Thread Jacqui Caren-home
Greg Smith wrote: Set -c 300 when you run pgtune and it will do the right thing here. regarding tuning a database we had a rather neat tool for oracle some years ago that would connect to a live database and monitor the QEP (query execution plan) cache for badly indexed queries etc. It would

Re: [GENERAL] Problem with dumps

2010-08-11 Thread Guillaume Lelarge
Le 09/08/2010 20:04, Bill Christensen a écrit : Hi folks, I'm building a new server with postgres/phppgadmin, and having trouble getting the dumps to work properly. This is my first time installing postgres, so I very well may have missed something. Do you use the same server for

[GENERAL] Problem with Constraint Exclusion ON

2010-08-11 Thread Ashish Karalkar
Hello All, I am facing problem with constraint exclusion in table partitioning. I have master table and 10 child table's with list partitioning. constraint exclusion ON works for all the check constraint except for the NOT IN check constraint. Is this an expected ? Here is an example:

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Daniel Verite
Greg Smith wrote: The problem is that few discussions happen on these lists for things like how do I get used to PostgreSQL after growing up on MySQL? And that material will never be appropriate for the PostgreSQL documentation. I would highly encourage people to migrate their

Re: [GENERAL] fork() and dynamically loaded c functions....

2010-08-11 Thread Jay Flattery
You might find that doing on_exit_reset() in the child would fix the worst problems, but it still sounds chancy as heck. Thanks for that. The fork() is certainly more convenient than exec'g something else - hopefully OK since we're just prototyping something. Quick question: where is

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Marco Colombo
On 11/08/2010 04:01, Greg Smith wrote: 3. The default configuration settings for PostgreSQL are not optimal for performance. Can there be a recommended configuration file in the installation (assuming certain amount of RAM and processor type) ? This doesn't work because there are many

[GENERAL] An aggregate function on ARRAY

2010-08-11 Thread Rafal Pietrak
Hi, I've started using ARRAY data type recently, and I fell into the following problem: When I have a relatively large ARRAY (like [1:500]) takeing an aggregate function on its elements is not so easy. One has to iterate all the elements, like this: SELECT min(A[1]) as a1, min(A[2]) as a2, ...

Re: [GENERAL] Is there a way to bypass sql?

2010-08-11 Thread Merlin Moncure
On Wed, Aug 11, 2010 at 1:31 AM, Samantha Atkins sjatk...@mac.com wrote: On Aug 9, 2010, at 11:57 AM, Merlin Moncure wrote: On Mon, Aug 9, 2010 at 2:39 PM, samantha sjatk...@mac.com wrote: I have been digging into NoSQL of late.  For navigational queries it would be great if there was a way

[GENERAL] How-to question: pre-parsing and pre-planning dynamic sql statements

2010-08-11 Thread Davor J.
Suppose you have a table CREATE TABLE tbl_formulas (formula_id integer, formula text) The formula field can be any postgres-supported mathematical operation which references some input data with $1 like sin($1) + cos($1) and returns one numeric value. Such formulas should be used in the SELECT

Re: [GENERAL] An aggregate function on ARRAY

2010-08-11 Thread Merlin Moncure
On Wed, Aug 11, 2010 at 8:42 AM, Rafal Pietrak ra...@zorro.isa-geek.com wrote: Hi, I've started using ARRAY data type recently, and I fell into the following problem: When I have a relatively large ARRAY (like [1:500]) takeing an aggregate function on its elements is not so easy. One has to

Re: [GENERAL] How-to question: pre-parsing and pre-planning dynamic sql statements

2010-08-11 Thread Merlin Moncure
On Wed, Aug 11, 2010 at 8:35 AM, Davor J. dav...@live.com wrote: Suppose you have a table CREATE TABLE tbl_formulas (formula_id integer, formula text) The formula field can be any postgres-supported mathematical operation which references some input data with $1 like sin($1) + cos($1) and

[GENERAL] Second request: Problem with dumps

2010-08-11 Thread Bill Christensen
I sent this a few days ago, and haven't heard any response. Apologies if this went out to the list but I don't see any way to search the archives, and I'm still looking for some answers. Hi folks, I'm building a new server with postgres/phppgadmin, and having trouble getting the dumps to

Re: [GENERAL] Is there a way to bypass sql?

2010-08-11 Thread Tom Lane
Samantha Atkins sjatk...@mac.com writes: In many OO projects the majority of the work on persistent objects is navigational and inserts with relatively few updates. Queries are usually mainly for initial working set in many such systems and little else. When retrieving an object given a

[GENERAL] filter tables from database

2010-08-11 Thread Garry Saddington
I can retrieve the table names in my database, but I would like to filter them based on the name of a field. Is this possible? Thanks Garry -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] filter tables from database

2010-08-11 Thread Thom Brown
On 11 August 2010 15:13, Garry Saddington ga...@schoolteachers.co.uk wrote: I can retrieve the table names in my database, but I would like to filter them based on the name of a field. Is this possible? Thanks Garry -- Hi Garry, You can do this: SELECT table_name FROM

Re: [GENERAL] Second request: Problem with dumps

2010-08-11 Thread Jens Wilke
Am Mittwoch 11 August 2010 16:20:27 schrieb Bill Christensen: Hi, Export error: Failed to execute pg_dump (given path in your conf/config.inc.php : Is pg_dump executable? Did you try to do a manual dump w/o phpadmin? Regards, Jens -- Sent via pgsql-general mailing list

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Greg Smith
Daniel Verite wrote: On the other hand, some of the notes already mentioned on the wiki, such as for example: http://www.xach.com/aolserver/mysql-to-postgresql.html ...are so outdated and/or bad that they're probably counter-productive. ... IMHO such contents should simply be scraped/unlinked.

[GENERAL] Is it possible to change password though pg_auth?

2010-08-11 Thread Frank Church
Is it possible to change password through pg_auth? I am developing a VM where may be necessary to reset passwords through a web interface, without having postgresql actually running. If the users are already set in the database, can the passwords be changed by adding their md5 encoding to

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Greg Smith
Marco Colombo wrote: Well, many defaults are hardcoded into a file now. I'd like to see 'auto' among possible values of parameters, e.g.: with PG wild guessing reasonable values based on system specs. It may be a awful piece of code (getting system info is very platform specific), and

[GENERAL] Restore from online backup, query from pg_proc, got wrong result, please see the problem!

2010-08-11 Thread Richard
After restoring from online backup and archive xlog files, I query pg_proc using SQL: select * from pg_proc where proname = 'xxx' and oid = XXX. I got no result back, but when using SQL:select * from pg_proc where proname = 'xxx', I got what I want, and the result OID is just the one in the

Re: [GENERAL] Restore from online backup, query from pg_proc, got wrong result, please see the problem!

2010-08-11 Thread Tom Lane
Richard husttrip...@vip.sina.com writes: After restoring from online backup and archive xlog files, I query pg_proc using SQL: select * from pg_proc where proname = 'xxx' and oid = XXX. I got no result back, but when using SQL:select * from pg_proc where proname = 'xxx', I got what I want,

Re: [GENERAL] C++ User-defined functions

2010-08-11 Thread 3dmashup
This information is correct the header file libintl.h is NOT included in the binary distro. For a workaround, you can create an empty libintl.h file in local header directory and add that dir to the include path. -- View this message in context:

Re: [GENERAL] C++ User-defined functions

2010-08-11 Thread 3dmashup
This information is correct the header file libintl.h is NOT included in the binary distro. For a workaround, you can create an empty libintl.h file in local header directory and add that dir to the include path. When compilinga server side C function with VS2010 or VS2005 The struct

Re: [GENERAL] InitDB: Bad system call

2010-08-11 Thread Alvaro Herrera
Excerpts from Torsten Zühlsdorff's message of mié ago 11 02:52:34 -0400 2010: Hi Tom, Bad system call (core dumped) Have you tried running the initdb with strace or truss? That might give you a clue as to exactly what system call is failing. Your jail isn't allowing something

Re: [GENERAL] Restore from online backup, query from pg_proc, got wrong result, please see the problem!

2010-08-11 Thread Richard
I did the followwing things to make a backup: 1.config the archive on 2. select * from pg_start_backup() 3.tar the $PTDATA dir to a package 4.select * from pg_stop_backup() The followwing things to restore: 1.Unzip the tar package I packaged 2.Copy the archived XLOG fils to $PTDATA 3.pg_ctl start

[Some body help me, please!]Re: Re: [GENERAL] Restore from online backup, query from pg_proc, got wrong result, please see the problem!

2010-08-11 Thread Richard
-- Richard 2010-08-12 - 发件人:Richard 发送日期:2010-08-12 00:11:13 收件人:Tom Lane 抄送:pgsql-general 主题:Re: [GENERAL] Restore from online backup, query from pg_proc, got wrong result, please see

Re: [GENERAL] How-to question: pre-parsing and pre-planning dynamic sql statements

2010-08-11 Thread Merlin Moncure
On Wed, Aug 11, 2010 at 11:57 AM, Davor J. dav...@live.com wrote: On 11/08/2010 16:26, Merlin Moncure wrote: On Wed, Aug 11, 2010 at 8:35 AM, Davor J.dav...@live.com  wrote: Suppose you have a table CREATE TABLE tbl_formulas (formula_id integer, formula text) The formula field can be any

Re: [GENERAL] InitDB: Bad system call

2010-08-11 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Torsten Zühlsdorff's message of mié ago 11 02:52:34 -0400 2010: Bad system call (core dumped) I think you should try harder to generate the core file. Maybe you have too low an ulimit -c setting? The kernel message

Re: [GENERAL] pgtune

2010-08-11 Thread Greg Smith
Jacqui Caren-home wrote: we had a rather neat tool for oracle some years ago that would connect to a live database and monitor the QEP (query execution plan) cache for badly indexed queries etc. It would use this information (with the schema meta data) to suggest creation and deletion of indices

[GENERAL] pg_dump and boolean format

2010-08-11 Thread Scott Frankel
Hi all, Is it possible to control the representation of boolean data in a pg_dump? The pg docs say that booleans can be stored as 't', 'true', 'y', 'yes', or '1'. My db is storing them as 't' and pg_dump is outputing them as 'true'. Can I coerce pg_dump to output 't' as 1? I'm using

Re: [GENERAL] Finding last checkpoint time

2010-08-11 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Greg Sabino Mullane wrote: Specifically, LANGUAGE changes the headers of pg_controldata (but not the actual output, LC_ALL does that). Thanks for the nudge, I'll get to rewriting some code. pg_upgrade does this in controldata.c

Re: [GENERAL] pg_dump and boolean format

2010-08-11 Thread Michael Glaesemann
On Aug 11, 2010, at 13:00 , Scott Frankel wrote: The pg docs say that booleans can be stored as 't', 'true', 'y', 'yes', or '1'. Booleans are not stored as those literals: those are only acceptable literals (i.e., string representations) for boolean values. I'm using pg_dump to create an

[GENERAL] PG-friendly CASE/modeling tool?

2010-08-11 Thread Michael C Rosenstein
Hello. We are new to Postgres, and are in the process of migrating our project's app from Oracle. I have been using Embarcadero's ER/Studio as a data modeling/DDL tool for 15 years (and love it!), but its support for Postgres 8.4 is weak (e.g., missing many datatypes, no function-based

Re: [GENERAL] PG-friendly CASE/modeling tool?

2010-08-11 Thread Joshua D. Drake
On Wed, 2010-08-11 at 13:17 -0400, Michael C Rosenstein wrote: Hello. We are new to Postgres, and are in the process of migrating our project's app from Oracle. I have been using Embarcadero's ER/Studio as a data modeling/DDL tool for 15 years (and love it!), but its support for Postgres

[GENERAL] 8 trigger record(s) not found for relation managements

2010-08-11 Thread rh
Hi, I'm getting this error when trying to select from a table: 8 trigger record(s) not found for relation managements Looking into this a little, I found this page http://www.postgresql.org/docs/8.0/static/catalog-pg-trigger.html that says: Note: pg_class.reltriggers needs to agree with the

Re: [GENERAL] Is there a way to bypass sql?

2010-08-11 Thread Adrian von Bidder
On Wednesday 11 August 2010 07.31:24 Samantha Atkins wrote: There is also the interesting case of dynamic OO languages where technically the object fields do not have a defined type to start with. I'm not sure what you want to say here. If you apply this to databases, my answer is: if you

Re: [GENERAL] 8 trigger record(s) not found for relation managements

2010-08-11 Thread Alvaro Herrera
Excerpts from rh's message of mié ago 11 15:24:33 -0400 2010: Hi, I'm getting this error when trying to select from a table: 8 trigger record(s) not found for relation managements Looking into this a little, I found this page http://www.postgresql.org/docs/8.0/static/catalog-pg-trigger.html

Re: [GENERAL] JASPA (JAva SPATial) for PostgreSQL and H2 released

2010-08-11 Thread Bruce Momjian
John R Pierce wrote: On 07/23/10 3:48 PM, Kerry Sainsbury wrote: Is it really GPL? Any code I write that uses JASPA must also be GPL'ed? Shouldn't it be LGPL? IANAL, but if this is PL/Java based, then your code shouldn't need to be GPL as you're not linking with it, you're just

Re: [GENERAL] pg_dump and boolean format

2010-08-11 Thread Scott Frankel
On Aug 11, 2010, at 10:12 AM, Michael Glaesemann wrote: On Aug 11, 2010, at 13:00 , Scott Frankel wrote: The pg docs say that booleans can be stored as 't', 'true', 'y', 'yes', or '1'. Booleans are not stored as those literals: those are only acceptable literals (i.e., string

Re: [GENERAL] pg_dump and boolean format

2010-08-11 Thread Michael Glaesemann
On Aug 11, 2010, at 18:21 , Scott Frankel wrote: On Aug 11, 2010, at 10:12 AM, Michael Glaesemann wrote: One option is to use COPY to export the data in a format you like. For example: COPY (SELECT CAST(boolean_column AS INT) FROM my_table) TO STDOUT. Then write a script which reads

Re: [GENERAL] pg_dump and boolean format

2010-08-11 Thread Scott Frankel
On Aug 11, 2010, at 3:57 PM, Michael Glaesemann wrote: On Aug 11, 2010, at 18:21 , Scott Frankel wrote: On Aug 11, 2010, at 10:12 AM, Michael Glaesemann wrote: One option is to use COPY to export the data in a format you like. For example: COPY (SELECT CAST(boolean_column AS INT) FROM

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Marco Colombo
On 11/08/2010 17:34, Greg Smith wrote: The problem here is that the amount of shared memory a system can allocate is hard to discover any other way than starting the server and seeing if it works. So doing what you advise will leave the database unable to start on any system that hasn't gotten

Re: [GENERAL] deadlock

2010-08-11 Thread David Fetter
On Tue, Aug 10, 2010 at 11:35:48PM -0700, John R Pierce wrote: We've got an app, I don't know all the details of the schema offhand, but its using date partitioned tables, its heavily multithreaded and processing continuous events... Under load, production (overseas) is getting a SQL

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Tom Lane
Marco Colombo pg...@esiway.net writes: It's a matter of correctness: I see PG as a high performance database system. Allowing to start it in awfully suboptimal conditions it's no different from allowing '-00-00' as a date: it may give you the idea you did the right thing, but most of

Re: [GENERAL] Comparison of Oracle and PostgreSQL full text search

2010-08-11 Thread Bruce Momjian
Greg Smith wrote: Greg Williamson wrote: Our tests -- very much oriented at postGIS found Oracle to be between 5 and 15% _faster_ depending on the specifics of the task. We decided to go with postgres given the price difference (several hundred thousand dollars for Oracle in the

Re: [GENERAL] Comparison of Oracle and PostgreSQL full text search

2010-08-11 Thread Bruce Momjian
Greg Smith wrote: Tom Lane wrote: I'm sure EnterpriseDB or one of the other PG support companies would be happy to sell you a support contract, if having somebody to sue is an essential part of happiness. And on a good day, access to someone with the source code who will actually

Re: [GENERAL] Comparison of Oracle and PostgreSQL full text search

2010-08-11 Thread Bruce Momjian
Paul Ramsey wrote: Did the FAA ever publish slides of those talks? Sure wish I could see them... :) No, sorry, I don't think I ever saw the slides published. --- P. On 2010-08-11, at 6:58 PM, Bruce Momjian

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Ma Sivakumar
2010/8/12 Tom Lane t...@sss.pgh.pa.us: Unfortunately, there are quite a few of us for whom correctness doesn't mean automatically try to eat all the resources available. Your view of what is useful behavior is far too narrow-minded ... The point is, some one installing PostgreSQL for the

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Greg Smith
Ma Sivakumar wrote: There can be a stronger and more prominent hint / recommendation in postgresql.conf file, in install README, Resource Consumption section of manual (http://www.postgresql.org/docs/8.4/interactive/runtime-config-resource.html) and other appropriate places What you might

Re: [GENERAL] Comparison of Oracle and PostgreSQL full text search

2010-08-11 Thread Paul Ramsey
Did the FAA ever publish slides of those talks? Sure wish I could see them... :) P. On 2010-08-11, at 6:58 PM, Bruce Momjian br...@momjian.us wrote: Greg Smith wrote: Greg Williamson wrote: Our tests -- very much oriented at postGIS found Oracle to be between 5 and 15% _faster_ depending on

Re: [GENERAL] deadlock

2010-08-11 Thread John R Pierce
On 08/11/10 6:32 PM, David Fetter wrote: does anyone have any suggestions for what to look for, or what sort of common partition management mistakes in the application could lead to this sort of deadlock? DDL is a don't do it at peak load event. More realistically, it's more like a down time

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Sandeep Srinivasa
On Thu, Aug 12, 2010 at 10:53 AM, Greg Smith g...@2ndquadrant.com wrote: If only it were that easy. 25%, but only on a dedicated server, don't go above 8GB, limit to much less than that on Windows, and be extremely careful if you're writing heavily lest large checkpoints squash you. Giving

Re: [GENERAL] MySQL versus Postgres

2010-08-11 Thread Greg Smith
Sandeep Srinivasa wrote: Maybe a tabular form would be nice - work_mem under... The problem with work_mem in particular is that the useful range depends quite a bit on how complicated you expect the average query running to be. pgtune tries to model this using an input of what type of