Re: [GENERAL] psql + autocommit

2004-09-21 Thread Michael Paesold
Greg Sabino Mullane wrote: real_psql --set AUTOCOMMIT=OFF $@ I have stumbled over this myself: psql is case-sensitive here at the moment, so it must be --set AUTOCOMMIT=off. Best Regards, Michael ---(end of broadcast)--- TIP 8: explain analyze

[GENERAL] Stored Procedures

2004-09-21 Thread Kent Anderson
We are currently switching to stored procedures for a lot of our database activity. The question has come up about the transactional nature of the stored procedures. I was wondering if stored procedures can have transactions in themor if you must start the transaction in your code and call

Re: [GENERAL] Stored Procedures

2004-09-21 Thread Alvaro Herrera
On Tue, Sep 21, 2004 at 07:41:31AM -0400, Kent Anderson wrote: We are currently switching to stored procedures for a lot of our database activity. The question has come up about the transactional nature of the stored procedures. I was wondering if stored procedures can have transactions in

[GENERAL] abnormal data grow

2004-09-21 Thread Reynard Hilman
Hi, I have been having this problem where the database size suddenly grows from the normal size of about 300Mb to 12Gb in one night. When I look up the table size, the biggest one is only 41Mb and the total of all table size is only 223Mb. But in the filesystem data directory the total size is

Re: [GENERAL] abnormal data grow

2004-09-21 Thread Tom Lane
Reynard Hilman [EMAIL PROTECTED] writes: But in the filesystem data directory the total size is 12Gb. I noticed there are 10 files with 1Gb size each: 1.1G25677563 1.1G25677563.1 ... I'm just wondering is there a way to know what that 25677563 file is? select relname from

Re: [GENERAL] abnormal data grow

2004-09-21 Thread Doug McNaught
Reynard Hilman [EMAIL PROTECTED] writes: Hi, I have been having this problem where the database size suddenly grows from the normal size of about 300Mb to 12Gb in one night. When I look up the table size, the biggest one is only 41Mb and the total of all table size is only 223Mb. But in

Re: [GENERAL] abnormal data grow

2004-09-21 Thread Alvaro Herrera
On Tue, Sep 21, 2004 at 09:51:15AM -0500, Reynard Hilman wrote: I'm just wondering is there a way to know what that 25677563 file is? Why does postgres create a copy of that file with .1, .2, .3, etc. Those are not copies. Postgres splits each relation (table/index) in 1GB files. So the

Re: [GENERAL] abnormal data grow

2004-09-21 Thread Reynard Hilman
Is that file still in used (because I can't find it in the pg_class table)? Yes. Don't delete it manually. Thanks for that advice :) I wasn't really going to delete it, just tempted to. following Tom's advice, this query: select relname from pg_class where relfilenode = 25677563;

Re: [GENERAL] using database for queuing operations?

2004-09-21 Thread Greg Stark
Tom Lane [EMAIL PROTECTED] writes: which does not exist; in fact archives.postgresql.org has hardly anything for that whole month of pgsql-sql. Marc, any idea what's wrong there? The data was obviously there last time Oleg trolled for it. Oh, and btw, archives.postgresql.org search doesn't

[GENERAL] gist index woes

2004-09-21 Thread Pierre-Frdric Caillaud
Trying to build a gist index on a column in a table. The table contains 100k rows. The column is an integer[]. Each row contains about 20-30 distinct values chosen between 1 and 437. Aim : search the arrays with the gist integer array operators @ etc. Creating the index with gist__int_ops

Re: [GENERAL] abnormal data grow

2004-09-21 Thread Tom Lane
Reynard Hilman [EMAIL PROTECTED] writes: following Tom's advice, this query: select relname from pg_class where relfilenode = 25677563; returns pg_toast_25677561 which is the record in pg_class that has the biggest relpages, so that makes sense. Okay, so you have a lot of wide (toasted)

[GENERAL] Oracle / Postgres Interface

2004-09-21 Thread Shah, Sameer
Hi All, I would appreciate any input on this dilemma: I have DataBase-A which is Oracle on Server A with FunctionA (PLSQL) I have DataBase-B which is Postgress on Server B with FunctionB (PgSQL) I need to call FunctionA from FunctionB I dont mind rewriting PgSQL

Re: [GENERAL] Oracle / Postgres Interface

2004-09-21 Thread Doug McNaught
Shah, Sameer [EMAIL PROTECTED] writes: 1. I have DataBase-A which is Oracle on Server A with FunctionA (PLSQL) 2. I have DataBase-B which is Postgress on Server B with FunctionB (PgSQL) 3. I need to call FunctionA from FunctionB As far as I know, the on'y way to do

Re: [GENERAL] Oracle / Postgres Interface

2004-09-21 Thread Greg Stark
Doug McNaught [EMAIL PROTECTED] writes: Shah, Sameer [EMAIL PROTECTED] writes: 1. I have DataBase-A which is Oracle on Server A with FunctionA (PLSQL) 2. I have DataBase-B which is Postgress on Server B with FunctionB (PgSQL) 3. I need to call FunctionA

Re: [GENERAL] abnormal data grow

2004-09-21 Thread Reynard Hilman
Okay, so you have a lot of wide (toasted) fields in whatever table that toast table belongs to --- if you're not sure, try select relname from pg_class where reltoastrelid = (select oid from pg_class where relfilenode = 25677563); VACUUM VERBOSE on that table would give some useful info.

Re: [GENERAL] Stored Procedures

2004-09-21 Thread Alvaro Herrera
On Tue, Sep 21, 2004 at 11:11:33AM -0700, Chris Travers wrote: Alvaro Herrera wrote: There's only one transaction (whether it's an explicit transaction block or an implicit one), and the query that invokes the stored procedure is already running inside it. So the stored procedure always has

[GENERAL] Set return function with union all

2004-09-21 Thread Josué Maldonado
Hello list, is there a way to write in plpgsql the query that returns a set of this: create view xxx as (select '3ARR' as level, dpe_stamp from detpa where dpe_productfk=1 order by 2 desc limit 1) union all (select '2CAM' as level, dpe_stamp from detpc where dpe_productfk=1 order by 2 desc limit

[GENERAL] Prioritizing queries

2004-09-21 Thread Christopher Petrilli
Has anyone investigated having either high, or low urgency queries? A system I'm working on has a constant inflow of data, which has some queries gainst it which might require long sequential scans. I'm not that worried about how long those queries take, just that they don't interfere with other

[GENERAL] the current scoop on ilike and indexes

2004-09-21 Thread Kevin Murphy
I am pretty sure the answer is no, but ... is there any way to get 'ilike' to use an index? It seems like something that a lot of people would want to do. Otherwise, should I just create redundant case-mapped columns and use 'like'? Thanks, Kevin Murphy ---(end of

Re: [GENERAL] the current scoop on ilike and indexes

2004-09-21 Thread Thomas F . O'Connell
You can use an index on an expression like lower( col ) LIKE ... as long as the LIKE expression is left-anchored. See http://www.postgresql.org/docs/7.4/static/indexes-expressional.html -tfo On Sep 21, 2004, at 1:16 PM, Kevin Murphy wrote: I am pretty sure the answer is no, but ... is there any

Re: [GENERAL] Prioritizing queries

2004-09-21 Thread Steve Atkins
On Tue, Sep 21, 2004 at 04:24:21PM -0400, Christopher Petrilli wrote: Has anyone investigated having either high, or low urgency queries? A system I'm working on has a constant inflow of data, which has some queries gainst it which might require long sequential scans. I'm not that worried

Re: [GENERAL] the current scoop on ilike and indexes

2004-09-21 Thread Kevin Murphy
On Sep 21, 2004, at 4:52 PM, Thomas F.O'Connell wrote: You can use an index on an expression like lower( col ) LIKE ... as long as the LIKE expression is left-anchored. See Yes, I know that already. I wasn't talking about LIKE; I was talking about ILIKE. The data in the column is mixed-case.

Re: [GENERAL] the current scoop on ilike and indexes

2004-09-21 Thread Thomas F . O'Connell
So the answer is that ILIKE will not use indexes. But using lower()/LIKE will give you exactly the same results. lower() forces all column data to lower case for the purposes of comparison. -tfo On Sep 21, 2004, at 4:07 PM, Kevin Murphy wrote: On Sep 21, 2004, at 4:52 PM, Thomas F.O'Connell

[GENERAL] Unable to drop DB in latest CVS version

2004-09-21 Thread Ed L.
I'm trying to unsuccessfully to drop a database using the latest CVS code for 8.0.0, getting the following error: ERROR: cannot drop the currently open database So I must have a connection open, right? So I look for connections with the command I use on 7.3.4 but see nothing: SELECT

Re: [GENERAL] Unable to drop DB in latest CVS version

2004-09-21 Thread Ed L.
On Tuesday September 21 2004 4:01, Ed L. wrote: I'm trying to unsuccessfully to drop a database using the latest CVS code for 8.0.0, getting the following error: Duh. Operator error. Ed ---(end of broadcast)--- TIP 1: subscribe and unsubscribe

[GENERAL] difference 7.3.xx vs 7.4.xx

2004-09-21 Thread Dennis Gearon
I just read release notes for 7.4 where it said:( in plpgsql) allows declaration of record type without %ROWTYPE So, before that, there was no way to have a record returned of arbitrary fields from a User Defined Function? ---(end of

[GENERAL] Trouble with query logging

2004-09-21 Thread ppi
I'm having difficulty getting postgresql to log queries. I have the following set in my postgresql.conf: --- # - Syslog - syslog = 2 # range 0-2; 0=stdout; 1=both; 2=syslog syslog_facility = 'LOCAL0' syslog_ident = 'postgres' log_statement = yes

[GENERAL] brand new user - should I start with v8?

2004-09-21 Thread Miles Keaton
I'm a brand new PostgreSQL user -- just started today (though I've used MySQL for years). Should I just start learning with version 8, since I'm sure I won't launch any real live public projects with PostgreSQL for another few months? Any estimate when 8.0.0 will be final production-ready?

Re: [GENERAL] brand new user - should I start with v8?

2004-09-21 Thread Tom Lane
Miles Keaton [EMAIL PROTECTED] writes: I'm a brand new PostgreSQL user -- just started today (though I've used MySQL for years). Should I just start learning with version 8, since I'm sure I won't launch any real live public projects with PostgreSQL for another few months? Sure. 8.0 is