[GENERAL] Is dropping pg_ts_* harmful?

2009-02-02 Thread Eric Brown
arser. Are these tables safe to drop? Will the remnants of tsearch2 be anywhere else in the database if it was never used? Thanks folks -- -- Eric Brown / Director of IT / www.mediweightlossclinics.com

[GENERAL] reltuples < # of rows

2005-02-23 Thread Eric Brown
| relpages ---+-- 1760 |21119 (1 row) siteserverdb=# select count(*) from t_stats; count --- 1861 (1 row) How is this possible? I'm running postgres 8.0 on a redhat ws3. Clearly I'm not vacuuming enough, but that seems to be a separate issue to me. Am I seeing data corruption? Thanks,

[GENERAL] How can I expand serialized BLOBs into pseudo columns

2004-12-04 Thread Eric Brown
I have a table (quite a few of them actually) where python objects are serialized into a column. So a table might look like: CREATE TABLE mytable (id int, obj bytea); When I'm trying to diagnose/debug things, I'd like to be able to expand the 'obj' column into multiple columns in a view. I create

[GENERAL] Questions on stored-procedure best practices

2004-12-10 Thread Eric Brown
me share variables and I think these are more for splitting up table name-spaces than for associating a group of functions. other: Any other suggestions? Thanks. Eric Brown 408-571-6341 www.propel.com ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

[GENERAL] What's faster

2004-12-10 Thread Eric Brown
Option 1: create table a (id serial, hosts text[]); OR Option 2: create table a (id serial); create table hosts (id int references a, host text); Table 'a' will have about 500,000 records. There will probably be about 20 reads for every write. Each id has approximately 1.1 hosts. If I use the arr

[GENERAL] Running functions that return void in psql

2004-12-15 Thread Eric Brown
I've got quite a few plpgsql functions that insert, update or delete. They're all declared to return void. All other functions, I can just run 'select f(...);' from psql to test them. I don't understand how to test these ones that return void from psql. Thanks. ---(end o

[GENERAL] pgplsql SELECT INTO ... FOR UPDATE (transaction/locking question)

2004-12-15 Thread Eric Brown
I'm trying to write a stored procedure in plpgsql that selects a row and possibly increments one of its fields. I thought I would do SELECT INTO my_record * FROM my_table FOR UPDATE WHERE ..., but apparently plpgsql doesn't like the FOR UPDATE in a stored procedure. Does plpgsql automatically lock

Re: [GENERAL] Running functions that return void in psql

2004-12-15 Thread Eric Brown
Thanks. I forgot the 'return;' and the error message led me in the wrong direction. Thanks! On Dec 15, 2004, at 12:43 AM, Neil Conway wrote: Eric Brown wrote: I've got quite a few plpgsql functions that insert, update or delete. They're all declared to return void. All ot

[GENERAL] Long-running performance (MVCC, Vacuum, etc.) - Any fix?

2004-12-28 Thread Eric Brown
ws x 32 bytes/row fixed w/ 1 multi-column index, 1 single-column timestamp index AT 150,000 index search, 150,000 updates, 100s of reads per day 2,000,000 Rows x 4000 bytes avg/row AT 100,000 inserts per day, 150,000 reads per day Thanks, Eric Eric Brown 408-571-6341 www.propel.com --

[GENERAL] debug_print_plan (pg7.4) doesn't seem to do anything

2004-12-29 Thread Eric Brown
ought setting debug_print_plan was supposed to explain every query in my log file? I don't see the plan print either. I'm running version 7.4.6 (from fink) on OS X 10.3.7. Thanks. Eric Brown 408-571-6341 www.propel.com ---(end of broadcast)

Re: [GENERAL] debug_print_plan (pg7.4) doesn't seem to do anything

2004-12-29 Thread Eric Brown
On Dec 29, 2004, at 2:28 PM, Tom Lane wrote: Eric Brown <[EMAIL PROTECTED]> writes: I thought setting debug_print_plan was supposed to explain every query in my log file? I don't see the plan print either. No, it just prints the plan. With settings like yours I get I don't ge

Re: [GENERAL] debug_print_plan (pg7.4) doesn't seem to do anything

2004-12-29 Thread Eric Brown
On Dec 29, 2004, at 3:16 PM, Tom Lane wrote: Eric Brown <[EMAIL PROTECTED]> writes: On Dec 29, 2004, at 2:28 PM, Tom Lane wrote: Eric Brown <[EMAIL PROTECTED]> writes: I thought setting debug_print_plan was supposed to explain every query in my log file? I don't see the plan pri

[GENERAL] Passing a ROWTYPE to a function

2005-01-05 Thread Eric Brown
N psql:/tmp/test.sql:16: ERROR: column "item" does not exist CONTEXT: PL/pgSQL function "g2" line 4 at return I'm using posgresql 7.4.6. Thanks. Eric Brown 408-571-6341 www.propel.com

[GENERAL] Editor: Syntax highlighting and stored procedures surrounded by '

2005-01-06 Thread Eric Brown
? Thanks. Eric Brown 408-571-6341 www.propel.com ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Editor: Syntax highlighting and stored procedures surrounded by '

2005-01-06 Thread Eric Brown
On Jan 6, 2005, at 11:43 AM, Bruce Momjian wrote: Eric Brown wrote: I use emacs and syntax highlighting is great -- except that because stored procedures are completely enclosed between two single quotes, all the coloring is off for that portion. Is there a way to not surround stored procedures by

[GENERAL] Modifying search_path in a stored procedure

2005-01-11 Thread Eric Brown
et of data and one set of functions. It is fairly straight forward. However, it would be nice if I want to swap the schemas with the functions, I don't have to remember what data schema I was using. Thanks. Eric Brown 408-571-6341 www.propel.com ---(end of

[GENERAL] Running a void function in psql

2005-01-11 Thread Eric Brown
bbish? I just want to see errors or NOTICE/INFO strings I intentionally log. Thanks. Eric Brown 408-571-6341 www.propel.com ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail comman

[GENERAL] log_min_duration_statement

2005-01-26 Thread Eric Brown
CAC" Jan 26 02:26:17 abacagw postgres[28361]: [25-1] LOG: duration: 252.809 ms statement: FETCH 1 FROM "PgSQL_A8A3694C" Eric Brown 408-571-6341 www.propel.com ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[GENERAL] Getting "timeout expired" error almost immediately (20-200ms)

2006-06-02 Thread Eric Brown
I'm running 8.0.3 on Linux 2.6. Once my application starts to get a bit of load, I start getting application exceptions with the "timeout expired" string from postgresql. I think it is coming from src/interfaces/libpq/fe-misc.c. There is an interesting comment in that function (hasn't changed since