Re: [GENERAL] Deadlock situation?

2008-04-29 Thread Tom Lane
"Dan Armbrust" <[EMAIL PROTECTED]> writes: > I had to restart postgres to let things recover - so I can't gather > any more info right now - but if/when it happens again, I'd like to > know what else to gather. Well, there went the evidence :-( ... but what exactly did you have to do to shut it do

Re: [GENERAL] Character Data Type 'Name'

2008-04-29 Thread Tom Lane
Andy Anderson <[EMAIL PROTECTED]> writes: > I'm creating my own table of metadata about other tables in my > database. As such, one column will be the names of those other tables, > and the maximum length of the data in this column would be the allowed > length of an identifier. So one possib

Re: [GENERAL] Deadlock situation?

2008-04-29 Thread Alvaro Herrera
Dan Armbrust escribió: > select * from pg_stat_activity;" shows me that most of my connections > in a COMMIT phase: > > 03:05:37.73064-05 | 2008-04-24 03:05:38.419796-05 | 2008-04-24 > 02:11:53.908518-05 | 127.0.0.1 | 53807 > 16385 | ispaaa | 953 |16384 | pslogin | COMMIT

Re: [GENERAL] Deadlock situation?

2008-04-29 Thread Dan Armbrust
Semantics of deadlock aside, I seem to be deadlocked, yet postgres didn't detect any deadlock situation. There are no DDL queries running. Just a lot of updates, and some inserts and deletes. I had to restart postgres to let things recover - so I can't gather any more info right now - but if/whe

Re: [GENERAL] Deadlock situation?

2008-04-29 Thread Erik Jones
On Apr 29, 2008, at 4:54 PM, Dan Armbrust wrote: I have an app that we were load testing - it maintains a pool of connections to PostgreSQL - 8.3.1 Suddenly, after running fine for weeks, the app hung - unable to get a free connection from the pool. select * from pg_stat_activity;" shows me

[GENERAL] Deadlock situation?

2008-04-29 Thread Dan Armbrust
I have an app that we were load testing - it maintains a pool of connections to PostgreSQL - 8.3.1 Suddenly, after running fine for weeks, the app hung - unable to get a free connection from the pool. select * from pg_stat_activity;" shows me that most of my connections in a COMMIT phase: 03:0

[GENERAL] Character Data Type 'Name'

2008-04-29 Thread Andy Anderson
I'm creating my own table of metadata about other tables in my database. As such, one column will be the names of those other tables, and the maximum length of the data in this column would be the allowed length of an identifier. So one possible data type for this column would be 'varchar(N

Re: [GENERAL] Re: passing a temporary table with more than one column to a stored procedure

2008-04-29 Thread Viktor Rosenfeld
Hi Valentine, a little experimentation indicates that an aggregate function can solve my problem, using an int[] array as the state variable to encode the computed tuples of the result table so far and then using a costum function to decode the final returned array from the aggregate into

[GENERAL] psql \pset pager

2008-04-29 Thread Steve Crawford
My fingers sometimes run on "autoappend semicolon" mode and I end up typing "\pset pager always;" instead of "\pset pager always". No error is returned, short (but wide) output is not routed to the pager, and I have to back up and correct the \pset pager command. After some experimentation, I f

Re: [GENERAL] Why is postgres autovacuuming a table that is never updated?

2008-04-29 Thread Andrew Sullivan
On Tue, Apr 29, 2008 at 02:52:39PM -0400, Joseph S wrote: > I'm running 8.2.6. I have a log table that is always INSERTed to, and no > updates or deletes are ever run on. For some reason the autovacuum decided > it needed to vacuum this table, and it is slowing down my production > server. > >

Re: [GENERAL] Why is postgres autovacuuming a table that is never updated?

2008-04-29 Thread Alvaro Herrera
Joseph S wrote: > I'm running 8.2.6. I have a log table that is always INSERTed to, and > no updates or deletes are ever run on. For some reason the autovacuum > decided it needed to vacuum this table, and it is slowing down my > production server. Perhaps it's because the table is close t

[GENERAL] Why is postgres autovacuuming a table that is never updated?

2008-04-29 Thread Joseph S
I'm running 8.2.6. I have a log table that is always INSERTed to, and no updates or deletes are ever run on. For some reason the autovacuum decided it needed to vacuum this table, and it is slowing down my production server. So my questions are: 1) Why vacuum, if this table is never updated

Re: [GENERAL] Help! ERROR: could not open relation

2008-04-29 Thread Shane Ambler
Mircea Moisei wrote: I get this strange error Caused by: org.postgresql.util.PSQLException: ERROR: could not open relation 1663/53544/58374: No such file or directory How do I recover from it ? Postgresql version 8.2 on windows. Which update? 8.2.? - newer updates may have fixed the issue

Re: [GENERAL] pg_version is missing

2008-04-29 Thread Dot Yet
was there an explicit definition of $PGDATA variable pointing to the data_old location? rgds, dotyet On Fri, Apr 25, 2008 at 8:47 AM, Roberts, Jon <[EMAIL PROTECTED]> wrote: > I had a problem with a database yesterday on a Windows server. The > service was described as executing "C:\Program > F

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-29 Thread Robert Treat
On Monday 28 April 2008 17:35, Jeff Davis wrote: > On Sat, 2008-04-26 at 20:33 -0400, Robert Treat wrote: > > I think one of the best examples of this is the movie rating system > > (which I blogged about at > > http://people.planetpostgresql.org/xzilla/index.php?/archives/320-Postgre > >SQL-8.3-Fe

Re: [GENERAL] PITR problem

2008-04-29 Thread Erik Jones
On Apr 29, 2008, at 3:20 AM, wstrzalka wrote: What is the full pg_standby command string (restore_command=) in your recovery.conf. It sound's like you have pg_standby set to delete archived WALs and possibly have that a little too aggressive. Do you have the -k flag set in your pg_stan

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Tom Lane
Andreas Kretschmer <[EMAIL PROTECTED]> writes: >>> ... and I do something like "select id where animal <> 'Cat';" then >>> shouldn't 1, 3, 4 and 5 be picked? As it is I only get 1, 4 and 5. >>> NULL is not 'Cat'. I realize that if I were testing for NULL itself I > NULL is nothing, you can't co

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Stephan Szabo
On Mon, 28 Apr 2008 [EMAIL PROTECTED] wrote: > I'm fairly new to PG and databases in general so this may very well be > a problem in my thought process. > > If I have a simple table with an ID (integer) and Animal (text) like > this... > > 1 Dog > 2 Cat > 3 NULL > 4 Horse > 5 Pig > 6 Cat > 7 Cat >

Re: [GENERAL] Sorting nulls and empty strings together

2008-04-29 Thread Gregory Stark
"Andrus" <[EMAIL PROTECTED]> writes: > User interface need to show nulls as empty strings. > PostgreSQL sorts nulls after all data. >... > Select statements are generated dynamically by driver and it is not easy > to change them to generate order by coalesce( testcol,''). You could use NULLS FIRS

Re: [GENERAL] Sorting nulls and empty strings together

2008-04-29 Thread Martijn van Oosterhout
On Mon, Apr 28, 2008 at 08:05:45PM +0300, Andrus wrote: > User interface need to show nulls as empty strings. > PostgreSQL sorts nulls after all data. > > create temp table test ( testcol char(10) ); > insert into test values ( null); > insert into test values ( 'test'); > insert into test values

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Andreas Kretschmer
Pavel Stehule <[EMAIL PROTECTED]> schrieb: > > ... and I do something like "select id where animal <> 'Cat';" then > > shouldn't 1, 3, 4 and 5 be picked? As it is I only get 1, 4 and 5. > > NULL is not 'Cat'. I realize that if I were testing for NULL itself I NULL is nothing, you can't compare

Re: [GENERAL] varchar or text

2008-04-29 Thread Martijn van Oosterhout
On Tue, Apr 29, 2008 at 09:36:31AM +0200, Pascal Cohen wrote: > I am with 8.3.1 release but I mentioned that this appears with spaces at > then end not with standard chars. Of course your examples are working > fine but insert something like 'abc' (with several spaces and it > will work

Re: [GENERAL] Multibyte (Japanese Character) Sorting

2008-04-29 Thread Tatsuo Ishii
> Hi there, > > Im having a problem in sorting multibyte characters. > > I am using EUC-JP for my database encoding becuase we need to support > japanese (hiragana, katakana, kanji) text, since our clients are japanese. > > I have a table named "user_info" with the following fields: > > first_

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Pavel Stehule
Hello 2008/4/28 <[EMAIL PROTECTED]>: > Hi, > > I'm fairly new to PG and databases in general so this may very well be > a problem in my thought process. > > If I have a simple table with an ID (integer) and Animal (text) like > this... > > 1 Dog > 2 Cat > 3 NULL > 4 Horse > 5 Pig > 6 Cat > 7 Cat

[GENERAL] Delete xml node from xml-document

2008-04-29 Thread Oleg Malyovaniy
Hello! I try to delete some node from xml using plpgsql language How can I do it? To sample SELECT INTO xlst_templ '//myNode'; SELECT INTO v_xml XMLPARSE(DOCUMENT value) from myTable WHERE id=ids; RAISE NOTICE '%', v_xml; -- variable v_xml contain my xml document. SELECT INTO v_nodes x

[GENERAL] Sorting nulls and empty strings together

2008-04-29 Thread Andrus
User interface need to show nulls as empty strings. PostgreSQL sorts nulls after all data. create temp table test ( testcol char(10) ); insert into test values ( null); insert into test values ( 'test'); insert into test values ( ''); select * from test order by testcol; This confuses users who e

Re: [GENERAL] PITR problem

2008-04-29 Thread wstrzalka
> What is the full pg_standby command string (restore_command=) in > your recovery.conf. It sound's like you have pg_standby set to delete > archived WALs and possibly have that a little too aggressive. Do you > have the -k flag set in your pg_standby call in your restore_command? My restore

[GENERAL] question/problem concerning GRANT/REVOKE

2008-04-29 Thread Gerhard Wohlgenannt
hi! I have a pretty basic problem: We have several schemas in one of our databases, and we need the users to see only the tables (and table structure) of tables inside their own schema. So I created schemas for those users, and set their "search_path". But with \d public. users can see all

[GENERAL] Multibyte (Japanese Character) Sorting

2008-04-29 Thread Mhor Gonzales
Hi there, Im having a problem in sorting multibyte characters. I am using EUC-JP for my database encoding becuase we need to support japanese (hiragana, katakana, kanji) text, since our clients are japanese. I have a table named "user_info" with the following fields: first_name character(60)

[GENERAL] Help! ERROR: could not open relation

2008-04-29 Thread Mircea Moisei
I get this strange error Caused by: org.postgresql.util.PSQLException: ERROR: could not open relation 1663/53544/58374: No such file or directory How do I recover from it ? Postgresql version 8.2 on windows. I think I had an hardware issue in the past where my box rebooted few times I a

[GENERAL] String Comparison and NULL

2008-04-29 Thread seijin
Hi, I'm fairly new to PG and databases in general so this may very well be a problem in my thought process. If I have a simple table with an ID (integer) and Animal (text) like this... 1 Dog 2 Cat 3 NULL 4 Horse 5 Pig 6 Cat 7 Cat ... and I do something like "select id where animal <> 'Cat';" t

Re: [GENERAL] passing a temporary table with more than one column to a stored procedure

2008-04-29 Thread William Temperley
Viktor The quick and dirty method would be to pass the subquery as a string, then execute the subquery in the function. Will T -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Re: passing a temporary table with more than one column to a stored procedure

2008-04-29 Thread valgog
It looks like you need an aggregate function... but aggregate would work in case, you want to return a RECORD and not a SETOF RECORD. In this case, you probably need to operate with arrays. Are you on 8.3? If yes, you would be able to pass an array of type to your function. You can accumulate you

Re: [GENERAL] varchar or text

2008-04-29 Thread Pascal Cohen
Guillaume Lelarge wrote: Pascal Cohen a écrit : I had a look in previous posts in the forum but could not find the answer I was looking for. My question is should I switch from varchar to text. We have "discovered" although it seems to be SQL that adding something like 'text ' to

Re: [GENERAL] close database, nomount state

2008-04-29 Thread paul rivers
[EMAIL PROTECTED] wrote: Hello, I want to ask if there is something like nomount state or close database state in which I can acces postgresql to drop database or to do some other stuff. Because when there are some connections, drop database is not possible. Or is this done some other way? Luka