Re: [GENERAL] best way to manage indexes

2009-12-24 Thread Craig Ringer
On 24/12/2009 6:10 AM, Jamie Kahgee wrote: what would be considered best practice for my situation? I have a table *member*, with column *name *that I want to put an index on, because it is searched quiet frequently. When I create my sql search string, the name will consist only of

[GENERAL] Session based transaction!!

2009-12-24 Thread S Arvind
Hi Everyone, In a web application running in Tomcat and Postgres 8.3 as DB, i need to know whether my given task is feasible or not. All the db operation which is done by that web application must be rollback at the end(session dies) and the DB data must be same as the starting

Re: [GENERAL] WARNING: nonstandard use of escape in a string literal

2009-12-24 Thread Albe Laurenz
Patrick M. Rutkowski wrote: Is the query UPDATE my_table SET colname = NULL WHERE colname ~ '^\s*$' already all correct and standard conforming. Such that all I need to do is turn on standard_conforming_strings to have it stop complaining at me? Precisely. In other words: I'm already

Re: [GENERAL] WARNING: nonstandard use of escape in a string literal

2009-12-24 Thread Alban Hertroys
On 23 Dec 2009, at 22:58, Patrick M. Rutkowski wrote: In that case, let me put it this way: Is the query UPDATE my_table SET colname = NULL WHERE colname ~ '^\s*$' already all correct and standard conforming. Such that all I need to do is turn on standard_conforming_strings to have it

Re: [GENERAL] Session based transaction!!

2009-12-24 Thread Tino Wildenhain
Hi, S Arvind schrieb: Hi Everyone, In a web application running in Tomcat and Postgres 8.3 as DB, i need to know whether my given task is feasible or not. All the db operation which is done by that web application must be rollback at the end(session dies) and the DB data must be

Re: [GENERAL] How to get a list of tables that have a particular column value?

2009-12-24 Thread Rajan, Pavithra
Hello -Yes I need to find out the column value like '%Volt%' in any column of data_type (character varying) of any table. Basically what I need to do is go thro each columns of all tables and find any entries that have Voltage followed by some number e.g. 'Voltage 4.8000'.Then I need to use

Re: [GENERAL] postgres: writer process,what does this process actually do?

2009-12-24 Thread Thomas
On Dec 23, 3:44 pm, r...@iol.ie (Raymond O'Donnell) wrote: On 23/12/2009 02:56, Thomas wrote: And could you give me some info about postgres internals? Such as ebooks or online articles. There's quite a bit in the manual:  http://www.postgresql.org/docs/8.4/interactive/internals.html

[GENERAL] /var/lib/pgsql/data/pg_xlog/000000010000000000000000,two process access it ?

2009-12-24 Thread Thomas
I guess PID 19045 write data to the log file first when I insert data into table ,but why did writer process also access the log file ? Could some guy tell me some details ? FYI: postgres: writer process's PID is 18848 . postgres test [local] idle's PID is 19045 . [r...@localhost tmp]# lsof

Re: [GENERAL] defining yuor own commands in PG ?

2009-12-24 Thread Israel Brewster
On Dec 21, 2009, at 9:34 AM, Pavel Stehule wrote: 2009/12/21 Israel Brewster isr...@frontierflying.com: On Dec 19, 2009, at 2:59 AM, Filip Rembiałkowski wrote: 2009/12/18 Gauthier, Dave dave.gauth...@intel.com Can you define your own commands in PG. In psql, yes: \set sel 'SELECT *

[GENERAL] targetted array element modification or delete without knowing the index?

2009-12-24 Thread Gauthier, Dave
Is there a way to modify or delete an element of an array with knowledge only of the element's value? Maybe an array index finder would help? For example create table foo (name,text, arr text[]); insert into foo (name,arr) values ('joe',ARRAY['a','b','c']); update foo set

Re: [GENERAL] targetted array element modification or delete without knowing the index?

2009-12-24 Thread Richard Broersma
On Thu, Dec 24, 2009 at 10:01 AM, Gauthier, Dave dave.gauth...@intel.com wrote: Is there a way to modify or delete an element of an array with knowledge only of the element’s value?  Maybe an array index finder would help? I haven't tried it myself, but would the array contains operator work

[GENERAL] Updating from 8.2 to 8.4

2009-12-24 Thread Mark Morgan Lloyd
I was hoping to finally get the servers updated from 8.2 to 8.4 over the festive season, but by now I think I've left things too tight. Is it necessary to update the (Windows) ODBC driver as well? I've got a couple of app servers still on NT4 with ODBC 8.02.0100 which I'm trying to be careful

[GENERAL] Installation problem

2009-12-24 Thread Alexander Solovkin
Hello! I have problems with installation PostgreSQL 8.4.2 on Windows7x64. Installation passes normally, but in the end there is an error message of the following maintenance: Problem running post-instal step. Installation may not complete correctly. The database cluster initialisation failed. In

[GENERAL] Optimizing data layout for reporting in postgres

2009-12-24 Thread Doug El
Hi, I have to summarize some data to be queried and there are about 5 million raw records a day I need to summarize. In a nutshell I don't think I'm laying it out in an optimal fashion, or not taking advantage of some postgres features perhaps, I'm looking for feedback. The raw incoming data

[GENERAL] Any need to copy args before SPI C function callls SQL function?

2009-12-24 Thread J. Greg Davidson
I have some SPI C functions which dispatch to a selected PostgreSQL function based on the the first argument value. I have 3 questions and am very open to any other advise you might have: 1. If any of the arguments are bigger than a word, e.g. text or arrays, do I need to copy them into upper

Re: [GENERAL] Updating from 8.2 to 8.4

2009-12-24 Thread Adrian Klaver
On Thursday 24 December 2009 11:20:35 am Mark Morgan Lloyd wrote: I was hoping to finally get the servers updated from 8.2 to 8.4 over the festive season, but by now I think I've left things too tight. Is it necessary to update the (Windows) ODBC driver as well? I've got a couple of app

[GENERAL] cross-database time extract?

2009-12-24 Thread Israel Brewster
This is sort of a PostgreSQL question/sort of a general SQL question, so I apologize if this isn't the best place to ask. At any rate, I know in PostgreSQL you can issue a command like 'SELECT "time"(timestamp_column) from table_name' to get the time part of a timestamp. The problem is that this

Re: [GENERAL] How to get a list of tables that have a particular column value?

2009-12-24 Thread Adrian Klaver
On Thursday 24 December 2009 5:35:10 am Rajan, Pavithra wrote: Hello -Yes I need to find out the column value like '%Volt%' in any column of data_type (character varying) of any table. Basically what I need to do is go thro each columns of all tables and find any entries that have Voltage

[GENERAL] Esqsuig(!77. ca ccqyvxxghsqf

2009-12-24 Thread Raul Giucich
Poi Uyploiyuhytrwqwddhg grgrr. Sent from my iPhone -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] cross-database time extract?

2009-12-24 Thread Adrian Klaver
On Thursday 24 December 2009 1:44:58 pm Israel Brewster wrote: This is sort of a PostgreSQL question/sort of a general SQL question, so I apologize if this isn't the best place to ask. At any rate, I know in PostgreSQL you can issue a command like 'SELECT time(timestamp_column) from

Re: [GENERAL] cross-database time extract?

2009-12-24 Thread Adrian Klaver
On Thursday 24 December 2009 1:44:58 pm Israel Brewster wrote: This is sort of a PostgreSQL question/sort of a general SQL question, so I apologize if this isn't the best place to ask. At any rate, I know in PostgreSQL you can issue a command like 'SELECT time(timestamp_column) from

Re: [GENERAL] Optimizing data layout for reporting in postgres

2009-12-24 Thread Scott Marlowe
On Thu, Dec 24, 2009 at 1:01 PM, Doug El doug...@yahoo.com wrote: Hi, I have to summarize some data to be queried and there are about 5 million raw records a day I need to summarize. In a nutshell I don't think I'm laying it out in an optimal fashion, or not taking advantage of some

Re: [GENERAL] How to add month.year column validation

2009-12-24 Thread Andrus
Scott, You can use the regex I posted to get rid of the data easily, then go back to the substr one for a check constraint after that. regex is non-standard. How to implement this in standard SQL ? Andrus. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] How to add month.year column validation

2009-12-24 Thread Adrian Klaver
On Thursday 24 December 2009 3:47:23 pm Andrus wrote: Scott, You can use the regex I posted to get rid of the data easily, then go back to the substr one for a check constraint after that. regex is non-standard. How to implement this in standard SQL ? Andrus. Why should it matter? The

[GENERAL] date_trunc on date is immutable?

2009-12-24 Thread Kian Wright
I'm trying to create an index on the month and year of a date field (in 8.3), and I'm getting the functions in index expression must be marked IMMUTABLE error message. I thought dates were immutable, and didn't think that DATE_TRUNC did anything to change that. These all fail: create index

Re: [GENERAL] date_trunc on date is immutable?

2009-12-24 Thread Scott Marlowe
On Thu, Dec 24, 2009 at 4:36 PM, Kian Wright kian.wri...@senioreducators.com wrote: I'm trying to create an index on the month and year of a date field (in 8.3), and I'm getting the functions in index expression must be marked IMMUTABLE error message. If applied to a timestamp, it is

Re: [GENERAL] How to add month.year column validation

2009-12-24 Thread Scott Marlowe
On Thu, Dec 24, 2009 at 4:47 PM, Andrus kobrule...@hot.ee wrote: Scott, You can use the regex I posted to get rid of the data easily, then go back to the substr one for  a check constraint after that. regex is non-standard. How to implement this in standard SQL ? I take it you need a way

Re: [GENERAL] date_trunc on date is immutable?

2009-12-24 Thread Greg Stark
On Fri, Dec 25, 2009 at 12:56 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Thu, Dec 24, 2009 at 4:36 PM, Kian Wright kian.wri...@senioreducators.com wrote: I'm trying to create an index on the month and year of a date field (in 8.3), and I'm getting the functions in index expression

Re: [GENERAL] date_trunc on date is immutable?

2009-12-24 Thread Scott Marlowe
On Thu, Dec 24, 2009 at 6:47 PM, Greg Stark gsst...@mit.edu wrote: On Fri, Dec 25, 2009 at 12:56 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Thu, Dec 24, 2009 at 4:36 PM, Kian Wright kian.wri...@senioreducators.com wrote: I'm trying to create an index on the month and year of a date