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?

[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 (http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html#FUNCTIONS-

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 w

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 mac

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 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

[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)--- TI

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 whe

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 acc

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

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 to refer to whatever value on the payment records.  

[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 "/srv/db/pos

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 this would 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.

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

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 script

[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 Hatcher

[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_e

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

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 int

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] D

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 disc

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() > RETU

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

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 must

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 pgplsq

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 w

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 p

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_

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] 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] 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
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 broadcast)---

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. Pl

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] 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: http://

[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] 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 bot

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 (be

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 server

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. C

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] 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: Sent: Thursday, August 04, 2005 12:15 AM Subject: Re: [GENERAL] Instalation batch file

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

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, o

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

[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 sl

[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 inserting

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

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 --e

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 y