Re: [GENERAL] Slow Inserts on 1 table?

2005-08-05 Thread Gregory Youngblood
On Aug 2, 2005, at 8:16 AM, Alvaro Herrera wrote:On Tue, Aug 02, 2005 at 10:01:50AM -0500, Dan Armbrust wrote: I shouldn't have to manually run Analyze to make the DB be capable of handling inserts involving tables with foreign keys correctly.  My code that is doing the inserts is a java

Re: [GENERAL] untrusted languages and non-global superusers?

2005-08-05 Thread Chris Travers
CSN wrote: Convenience! I want the email sent whether the member is added via the web interface, directly in the database, from the command line, etc. I don't see any downside. It's only one user that'll be using this function. Well, there are three issues with doing complex things like

Re: [GENERAL] Cursor Issue??

2005-08-05 Thread DracKewl
Thanks Roman for sticking with me on this! For whatever reason I cannot load another langage, I think it has to do with recompiling the program and installing all the options. Not sure though?? LANGUAGE plpgsql doesn't exist for me. I still find this cursor limitation wacked. I find it hard to

Re: [GENERAL] Insert ImageFile in PostgreSQL

2005-08-05 Thread [EMAIL PROTECTED]
I'm sorry, but I know only the basics about DBMs, but I think is not possible to put a image file INSIDE a database. You can put in a database the path of the file... (Maybe I'm wrong...) See ya! ---(end of broadcast)--- TIP 3: Have you checked

Re: [GENERAL] indexes are fucked

2005-08-05 Thread Chris Travers
Dr NoName wrote: Hi all, I got another problem with postgres. This time it refuses to use the indexes. Check this out: If you would like help, first try posting queries and EXPLAIN ANALYZE dumps. Also you may have better luck with the Performance list ([EMAIL PROTECTED]). Best Wishes,

Re: [GENERAL] PostgreSQL vs. MySQL

2005-08-05 Thread littlebutty
Ou company just migrated in the opposite direction. We moved from MySQL 4.1 to PostgreSQL 8. We had serious issues with MySQL and foreign key support as well as data validation. For example: MySQL will simply insert an empty string value for a required field that was not supplied. We also

[GENERAL] Problems to install pg 8.0.3

2005-08-05 Thread [EMAIL PROTECTED]
Hi all. I want to install pg with readline. ./configure told me I have no readline. I downloaded it and installed it, but ./configure still outputing there is no readline. How can I solve it? Thx! Bye! ---(end of broadcast)--- TIP 6: explain

[GENERAL] Going beyond sql

2005-08-05 Thread Jon
Hi, I'd like to run some scripts against a postgres database but has more than just standard SQL commands. I'd like to be able to use conditional statements (i.e. if .. .then ... ) and such. I had a look and can see that I could use pgplsql for this. However it seems that it must be part of

[GENERAL] wanting to use postgres with python - WHAT am I doing wrong?????? AGGGHHHH

2005-08-05 Thread Ronni
I want to use postgres with python but I can't seem to get it working. If I read things correctly I need python installed then I need postgres installed. I did both on my Sun Solaris Opteron AMD 64 (Mandrake 10.1 os) using the --enable-shared and --with-python options. Both came back with

Re: [GENERAL] [pgsql-advocacy] New MySQL to PostgreSQL Migration Guide

2005-08-05 Thread Chris Travers
Christopher Kings-Lynne wrote: PDF not found? Argh Ok. Fixed. It is about 12 pages. Table of contents entries are clickable. I am not familiar enough with Docbook so I just wrote it in LaTeX (sources available upon request). Direct link is

Re: [GENERAL] Cursor Issue??

2005-08-05 Thread DracKewl
Hey Roman, Thanks for your reponse's! I made it happen in MicrosoftSQL using the first code below. The only difference is I had to create variables. Which I'm having a hard time trying to replicate it in psql. __Microsoft Code___ USE test GO DECLARE @qty INT, @Length

[GENERAL] How to explode an array into multiple rows

2005-08-05 Thread Kevin Murphy
I'd like to do something like this: select array_explode(array_col) from table1 where col2 = 'something'; where array_explode returns the elements of array_col unpacked onto separate rows. I tried creating a function returning a setof type, but postgresql produces a set-valued function

Re: [GENERAL] New MySQL to PostgreSQL Migration Guide

2005-08-05 Thread Chris Travers
To anyone who tried before, the link is fixed. http://www.metatrontech.com/wpapers/mysql2postgresql.pdf Chris Travers wrote: Hi; I have just posted a MySQL to PostgreSQL migration guide at http://www.metatrontech.com/wpapers and it is free for pretty much any use (I do have a somewhat

Re: [GENERAL] PostgreSQL vs. MySQL

2005-08-05 Thread Chris Travers
[EMAIL PROTECTED] wrote: Hi all, I am sorry for a stupid easy question, but I'am PostgreSQL novice. Our development team has encountered problem with trying to install and maintain cluster (pgcluster) on our production database. So they have decided to switch the entire solution to MySql

[GENERAL] Why pgsql function is working on vers 8.0/windows and not on ver 7.3.2/rad hat?

2005-08-05 Thread in-consulting.net
Hy, I'm using a type defined by me: output_mt, on the function CREATE OR REPLACE FUNCTION happy() RETURNS SETOF output_mt AS and when I want to initialize from another function: CREATE OR REPLACE FUNCTION msg() RETURNS output_mt AS as: output_mt=msg(); it gaves me: WARNING:

Re: [GENERAL] Tool for database design documentation?

2005-08-05 Thread littlebutty
Not a free utility, but a good one: http://www.datanamic.com/dezign/index.html ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

[GENERAL] Inheritance vs. LIKE - need advice

2005-08-05 Thread William Bug
Hi All, Sorry to bring up the topic of PostgreSQL inheritance again, but after going through the archives and Google results, I still don't have a clear sense of whether my plan to implement a schema I'm working on is the preferred way to go. First, I'd like to find out if the way I'm

Re: [GENERAL] DNS vs /etc/hosts

2005-08-05 Thread Gregory Youngblood
On Aug 4, 2005, at 2:39 PM, [EMAIL PROTECTED] wrote:Both dig and nslookup are fast on all machines.  'psql' is fast on all machines, as long as I am using the version compiled with version 7.2.  It is only 'psql' compiled with version 8.0 that is slow.  I don't think DNS is the problem, but rather

Re: [GENERAL] Insert ImageFile in PostgreSQL

2005-08-05 Thread Tino Wildenhain
Am Dienstag, den 02.08.2005, 08:52 -0700 schrieb [EMAIL PROTECTED]: I'm sorry, but I know only the basics about DBMs, but I think is not possible to put a image file INSIDE a database. You can put in a database the path of the file... (Maybe I'm wrong...) sorry to say that, but indeed you

Re: [GENERAL] wanting to use postgres with python - WHAT am I

2005-08-05 Thread Tino Wildenhain
Am Mittwoch, den 03.08.2005, 09:49 -0600 schrieb Ronni: I want to use postgres with python but I can't seem to get it working. If I read things correctly I need python installed then I need postgres installed. I did both on my Sun Solaris Opteron AMD 64 (Mandrake 10.1 os) using the

Re: [GENERAL] Postgresql Hosting

2005-08-05 Thread Emilian Ursu
On Fri, 5 Aug 2005, Richard Sydney-Smith wrote: I have asked my internet host to include postgresql as part of their service but it seems that there are issues in getting it to work with cpanel which is their support service for their clients. Is their a reason why Postgresql is harder to

[GENERAL] Weird lock or bug maybe?

2005-08-05 Thread Ben-Nes Yonatan
Hi All, I got 2 very simple tables, one hold few values and got a unique field to be used as identifier and the other table got a reference to that table (foreign key). At my last testing before the problem I inserted to each one of the tables about 1 million rows, for the process of

[GENERAL] Does preparing statements other than selects help performance?

2005-08-05 Thread David Goodenough
I was looking at an application recently which was written in Java and used Postgresql as it DB. In it extensive use had been made of PreparedStatements both for SELECTs and for INSERT, UPDATE and DELETE statements. Some of the routines had multiple UPDATEs doing much the same thing but with

Re: [GENERAL] Weird lock or bug maybe?

2005-08-05 Thread go
Hi there I have much problems with wierd locking too. I thing that it problem is connected with localisation - when i update a problem row (which have text fields) with any different text data in text fields - all locks dissapper. I hope this info can help to solve this bug (because in PG

Re: [GENERAL] Slow Inserts on 1 table?

2005-08-05 Thread Martijn van Oosterhout
On Tue, Aug 02, 2005 at 10:55:22AM -0700, Gregory Youngblood wrote: Not to fan the flames, so to speak, but I do have on question. If this is a known limitation, I'd expect the behavior to be consistent. Instead, he is saying that the problem is intermittent. Sometimes it runs fine,

Re: [GENERAL] renaming a table, and its primary key constraint

2005-08-05 Thread Martijn van Oosterhout
On Sat, Jul 30, 2005 at 02:02:16PM -0700, Jim wrote: Hello, Forgive me if this is a dopey question. I'm running a web app with a dB that takes me a half hour to regenerate. Instead of closing down every day, I'd like insert the data into a temp table stuff_tmp and then rename that to the

Re: [GENERAL] Instalation batch file

2005-08-05 Thread Zlatko Matić
Thank you for answer. It seems that %HOMEDRIVE% is just enough to solve this problem. Thanks. - Original Message - From: Glenn Davy [EMAIL PROTECTED] To: Zlatko Matić [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Thursday, August 04, 2005 12:15 AM Subject: Re: [GENERAL]

Re: [GENERAL] Does preparing statements other than selects help performance?

2005-08-05 Thread Martijn van Oosterhout
On Fri, Aug 05, 2005 at 10:08:42AM +0100, David Goodenough wrote: I was looking at an application recently which was written in Java and used Postgresql as it DB. In it extensive use had been made of PreparedStatements both for SELECTs and for INSERT, UPDATE and DELETE statements. Some of

Re: [GENERAL] Does preparing statements other than selects help performance?

2005-08-05 Thread Richard Huxton
David Goodenough wrote: This set me thinking (always dangerous). I can see how a SELECT can be helped by preparing the statement, but not really how an INSERT could or, other than the SELECT implicit in the WHERE clause on an UPDATE or DELETE, how UPDATE or DELETE statements would be helped.

Re: [GENERAL] Weird lock or bug maybe?

2005-08-05 Thread Richard Huxton
Ben-Nes Yonatan wrote: If ill query: DELETE FROM table1; it will just get stuck... If ill try: DELETE FROM table1 WHERE table1_id=1523; it will work in most cases but for some rows it will just get stuck! Anyone know anything about this weird problem? By the way when I restarted the DB

Re: [GENERAL] Weird lock or bug maybe?

2005-08-05 Thread Richard Huxton
go wrote: Hi there I have much problems with wierd locking too. I thing that it problem is connected with localisation - when i update a problem row (which have text fields) with any different text data in text fields - all locks dissapper. I hope this info can help to solve this bug

Re: [GENERAL] Does preparing statements other than selects help performance?

2005-08-05 Thread David Goodenough
On Friday 05 August 2005 11:57, Martijn van Oosterhout wrote: On Fri, Aug 05, 2005 at 10:08:42AM +0100, David Goodenough wrote: I was looking at an application recently which was written in Java and used Postgresql as it DB. In it extensive use had been made of PreparedStatements both for

[GENERAL] Optimizing large data loads

2005-08-05 Thread John Wells
Hi guys, We have a Java process that uses Hibernate to load approximately 14 GB of data. One a dual-proc 2.4 GHZ Xeon with 2048 MB RAM, it's currently taking over 13 hours to load (PostgreSQL 7.4.8). We're flushing from hibernate every 50 records. I've turned fsync to false in postgresql.conf,

Re: [GENERAL] wanting to use postgres with python - WHAT am I doing wrong?????? AGGGHHHH

2005-08-05 Thread Stephane Bortzmeyer
On Wed, Aug 03, 2005 at 09:49:18AM -0600, Ronni [EMAIL PROTECTED] wrote a message of 24 lines which said: I want to use postgres with python This is too vague. Do you want: 1) To do server-side programming in Python (creating functions in Python instead of plPgSQL or SQL)? If so:

Re: [GENERAL] DNS vs /etc/hosts

2005-08-05 Thread Thomas Pundt
Hi, On Thursday 04 August 2005 17:13, [EMAIL PROTECTED] wrote: | I am changing from 7.2 to 8.0 and have both installed now on various Linux | machines. When I use the psql command line interface with a -h hostname, | the connection time from 7.2 is instant while the connection time from 8.0 | is

Re: [GENERAL] Cursor Issue??

2005-08-05 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-08-04 09:56:03 -0700: Thanks Roman for sticking with me on this! For whatever reason I cannot load another langage, I think it has to do with recompiling the program and installing all the options. Not sure though?? LANGUAGE plpgsql doesn't exist for me.

Re: [GENERAL] How to write jobs in postgresql

2005-08-05 Thread Michael Fuhr
On Wed, Aug 03, 2005 at 09:08:48AM +0530, chiranjeevi.i wrote: Is it possible to write jobs in postgresql if possible how should I write .please help me. Please explain what you mean by job. What are you trying to do? -- Michael Fuhr ---(end of

Re: [GENERAL] Optimizing large data loads

2005-08-05 Thread Richard Huxton
John Wells wrote: Hi guys, We have a Java process that uses Hibernate to load approximately 14 GB of data. One a dual-proc 2.4 GHZ Xeon with 2048 MB RAM, it's currently taking over 13 hours to load (PostgreSQL 7.4.8). We're flushing from hibernate every 50 records. I've turned fsync to false

Re: [GENERAL] How to write jobs in postgresql

2005-08-05 Thread Michael Fuhr
[Please copy the mailing list on replies so others can contribute to and learn from the discussion.] On Fri, Aug 05, 2005 at 06:28:04PM +0530, chiranjeevi.i wrote: I have to dump up my database into a text file(using copy) at 2 am on every day. And from that I have to get the database details.

Re: [GENERAL] Problems to install pg 8.0.3

2005-08-05 Thread Tom Lane
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: I want to install pg with readline. ./configure told me I have no readline. I downloaded it and installed it, but ./configure still outputing there is no readline. How can I solve it? You probably need readline-devel as well.

Re: [GENERAL] renaming a table, and its primary key constraint

2005-08-05 Thread Tom Lane
Jim [EMAIL PROTECTED] writes: The table stuff_tmp has a primary key constraint. When I rename the table, this constraint does not get renamed-- it continues to have the name stuff_tmp_pkey-- and (you guessed it) the next time I run the script pg complains that it can't make stuff_tmp because

Re: [GENERAL] How to explode an array into multiple rows

2005-08-05 Thread Tom Lane
Kevin Murphy [EMAIL PROTECTED] writes: I'd like to do something like this: select array_explode(array_col) from table1 where col2 = 'something'; where array_explode returns the elements of array_col unpacked onto separate rows. I tried creating a function returning a setof type, but

Re: [GENERAL] How to write jobs in postgresql

2005-08-05 Thread Douglas McNaught
chiranjeevi.i [EMAIL PROTECTED] writes: Is it possible to write jobs in postgresql if possible how should I write .please help me. What does write jobs mean? -Doug ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will

Re: [GENERAL] Going beyond sql

2005-08-05 Thread Michael Fuhr
On Wed, Aug 03, 2005 at 06:50:48AM +1000, Jon wrote: I'd like to run some scripts against a postgres database but has more than just standard SQL commands. I'd like to be able to use conditional statements (i.e. if .. .then ... ) and such. I had a look and can see that I could use pgplsql

Re: [GENERAL] Going beyond sql

2005-08-05 Thread Laura Vance
Jon wrote: Hi, I'd like to run some scripts against a postgres database but has more than just standard SQL commands. I'd like to be able to use conditional statements (i.e. if .. .then ... ) and such. I had a look and can see that I could use pgplsql for this. However it seems that it

Re: [GENERAL] What causes lock??

2005-08-05 Thread Tom Lane
Frank Miles [EMAIL PROTECTED] writes: ... By the way, in this forced condition, the rows that show granted='f' have blank relname, relation, and database fields :( Those would be locks on transaction IDs, which is what you see in pg_locks when someone is blocked on a row-level lock. (For

Re: [GENERAL] Why pgsql function is working on vers 8.0/windows and not on ver 7.3.2/rad hat?

2005-08-05 Thread Michael Fuhr
On Tue, Aug 02, 2005 at 01:52:41PM +0300, in-consulting.net wrote: I'm using a type defined by me: output_mt, on the function CREATE OR REPLACE FUNCTION happy() RETURNS SETOF output_mt AS and when I want to initialize from another function: CREATE OR REPLACE FUNCTION msg() RETURNS

Re: [GENERAL] How to write jobs in postgresql

2005-08-05 Thread Bricklen Anderson
Douglas McNaught wrote: Is it possible to write jobs in postgresql if possible how should I write .please help me. What does write jobs mean? I'm assuming this person has an Oracle background, if so, jobs are Oracle's equivalent to a built-in cron scheduler. This has been discussed

Re: [GENERAL] DNS vs /etc/hosts

2005-08-05 Thread Lowell . Hought
How might I check for that? And if it is determined to be a problem, how would I remove the guilty modules? Thomas Pundt [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 08/05/2005 07:19 AM To pgsql-general@postgresql.org cc Lowell Hought/AGL/[EMAIL PROTECTED] Subject Re: [GENERAL] DNS

Re: [GENERAL] What causes lock??

2005-08-05 Thread Frank Miles
Following up on my question regarding locking... Well... I'm less and less inclined to think that the update/insert failure is due to a lock problem. Weird! Perhaps the python/psycopg interface? I've never had a case where the python/psycopg invocation worked differently than with the psql

Re: [GENERAL] DNS vs /etc/hosts

2005-08-05 Thread Lowell . Hought
Your are correct in that 8.0 is doing a request first. I am running Red Hat version 8.0. The difference in the way 7.2 and 8.0 resolve the host option has to be because of the change from gethostbyname to getaddrinfo. Is there some way I can force my machine to do an A search before a

[GENERAL] How to join function with a table?

2005-08-05 Thread Yudie Pg
Hi everyone, I have a function returning set of date called datelist(date,date) example: select * from datelist('8/1/2005, 8/5/2005'); 8/1/2005 8/2/3005 8/3/2004 8/4/2005 8/5/2005 I would like to join this function with a table create table payment( id int4 not null, date_start date, date_end

[GENERAL] slow update query

2005-08-05 Thread Patrick Hatcher
Pg 7.4.5 I'm running an update statement on about 2 million records using the following query: Update table_A set F1 = b.new_data from table_B b where b.keyfield = table_A.keyfield both keyfields are indexed, yet this job has been running over 3 hours. Is this normal? thanks Patrick

Re: [GENERAL] initskript after db start; locks on transactions

2005-08-05 Thread Thomas F. O'Connell
On Aug 3, 2005, at 4:33 PM, Thomas Chille wrote: Hi! I have have two questions: 1. What is the best approach to trigger a service script wich will clean up something in the db after every db (re-)start? Has PG its own mechanism for such things or have i to use my /etc/init.d/postgresql

Re: [GENERAL] DNS vs /etc/hosts

2005-08-05 Thread Thomas Pundt
Hi, On Friday 05 August 2005 16:21 [EMAIL PROTECTED] wrote: | How might I check for that? If it's a standard distribution kernel, try lsmod | grep ipv6 - this will show you if you have loaded the IPv6 module; try to remove the module by issueing rmmod ipv6. If that fails, you probably have to

Re: [GENERAL] How to join function with a table?

2005-08-05 Thread Pascual De Ruvo
On 8/5/05, Yudie Pg [EMAIL PROTECTED] wrote: I thought simple join like thiswould work, but it doesn't select * from payment P, datelist(P.date_start , P.date_end) try select * from payment as p, (select * from datelist('8/1/2005, 8/5/2005')) as date where date.. = p.

[GENERAL] Clog/Transaction problems

2005-08-05 Thread Logan Bowers
Hello, I have a really weird problem; queries against a very large table are failing against a very large table with a strange error. Case in point: dqfull=# vacuum freeze mytable; ERROR: could not access status of transaction 538989714 DETAIL: could not open file

Re: [GENERAL] How to join function with a table?

2005-08-05 Thread Yudie Pg
try select * from payment as p, (select * from datelist('8/1/2005, 8/5/2005')) as datewhere date.. = p. The problem is the function's parameters '8/1/2005', '8/5/2005' has torefer to whatever value on the payment records.

Re: [GENERAL] How to join function with a table?

2005-08-05 Thread Ragnar Hafstað
On Fri, 2005-08-05 at 10:53 -0500, Yudie Pg wrote: Hi everyone, I have a function returning set of date called datelist(date,date) example: select * from datelist('8/1/2005, 8/5/2005'); 8/1/2005 8/2/3005 8/3/2004 8/4/2005 8/5/2005 I would like to join this function with a table

Re: [GENERAL] Clog/Transaction problems

2005-08-05 Thread Alvaro Herrera
On Fri, Aug 05, 2005 at 04:52:29PM -0400, Logan Bowers wrote: Hello, I have a really weird problem; queries against a very large table are failing against a very large table with a strange error. Case in point: dqfull=# vacuum freeze mytable; ERROR: could not access status

Re: [GENERAL] How to join function with a table?

2005-08-05 Thread Yudie Pg
what about something likeselect id,datelistfrom payment as p,(select * from datelist('8/1/2005, 8/5/2005')) as list where datelist between p.date_start and p.date_end; That's works but have to put the whole date range into the parameters before it can be joined. This would need 2 queries where

[GENERAL] changing default lockfile location

2005-08-05 Thread snacktime
I'm trying to run two database clusters on the same box. Both are bound to their own ip but use the same port. I can't see a way to change the location of the lockfile on a per cluster basis though. Is there one? Chris ---(end of broadcast)---

Re: [GENERAL] changing default lockfile location

2005-08-05 Thread snacktime
On 8/5/05, snacktime [EMAIL PROTECTED] wrote: I'm trying to run two database clusters on the same box. Both are bound to their own ip but use the same port. I can't see a way to change the location of the lockfile on a per cluster basis though. Is there one? Chris Never mind, I figured

Re: [GENERAL] Insert ImageFile in PostgreSQL

2005-08-05 Thread Reid Thompson
[EMAIL PROTECTED] wrote: I'm sorry, but I know only the basics about DBMs, but I think is not possible to put a image file INSIDE a database. You can put in a database the path of the file... (Maybe I'm wrong...) See ya! ---(end of

Re: [GENERAL] DNS vs /etc/hosts

2005-08-05 Thread Tom Lane
[EMAIL PROTECTED] writes: Your are correct in that 8.0 is doing a request first. I am running Red Hat version 8.0. The difference in the way 7.2 and 8.0 resolve the host option has to be because of the change from gethostbyname to getaddrinfo. Is there some way I can force my

Re: [GENERAL] How to join function with a table?

2005-08-05 Thread Tom Lane
Yudie Pg [EMAIL PROTECTED] writes: I have a function returning set of date called datelist(date,date) ... I would like to join this function with a table create table payment( id int4 not null, date_start date, date_end date ) ... I thought simple join like this would work, but it

[GENERAL] timestamp default values

2005-08-05 Thread Brendan Jurd
Hi all, I have a table which is used for logging, and I want a timestamp column which reliably stores the insert time for each row inside a transaction, with maximum precision. Now, if I'm reading the documentation

Re: [GENERAL] timestamp default values

2005-08-05 Thread Tom Lane
Brendan Jurd [EMAIL PROTECTED] writes: timeofday() returns text, and moreover it returns in a bizarre format which cannot be converted directly into any useful temporal types, at least not in 8.0.2: Hm? Works fine for me. What datestyle setting do you have exactly?