[GENERAL] Exceptions in PL/Perl?

2005-08-11 Thread Jeff Boes
How does one raise an exception from a PL/Perl function? Specifically, this is a trigger function. Is it as simple as "die "? ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] World-wide Stop Order on PERL,Python,Java::->> Use

2005-08-11 Thread Jeff Boes
Al_Dev wrote: > World-wide Stop Order on PERL,Python,Java::->> Use Ruby instead > Al Dev > alavoor[at]-no-spam(dot)yahoo(dot)com There's irony for you. > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com Why yes, I am tired of spam. Thank you for asking!

[GENERAL] Reference new.* or old.* in dynamic statement?

2005-08-09 Thread Jeff Boes
I'm trying to write a general-purpose trigger that will disallow updates on certain fields (I could probably do this in other ways, but I have a stubborn streak ...). Given a table, I want to define a trigger on that table that will "write-protect" one column by name: CREATE TRIGGER tbl_nomod_cre

Re: [GENERAL] How to identify long-running queries, not just long-running backends?

2005-03-31 Thread Jeff Boes
Jeff Boes wrote: What I'm really hoping for is a way to get the "start time" for a query in pg_stat_activity. ... which I guess is pg_stat_activity.query_start. Duh. I will now hide under my desk for a while. (Don't know how I missed this; maybe I was looking at old do

[GENERAL] How to identify long-running queries, not just long-running backends?

2005-03-31 Thread Jeff Boes
nd elapsed time. What I'm really hoping for is a way to get the "start time" for a query in pg_stat_activity. I'm using 7.4.1, by the way. -- Jeff Boes Vox 269-226-9550 x24 Director of Software Development

Re: [GENERAL] Rule uses wrong value

2004-10-12 Thread Jeff Boes
Tom Lane wrote: Jeff Boes <[EMAIL PROTECTED]> writes: Tom Lane wrote: No kidding. A rule is a macro and therefore has the usual risks of multiple evaluations of arguments. But shouldn't "new.job_id" use the value that was already recorded in the original

Re: [GENERAL] Rule uses wrong value

2004-10-12 Thread Jeff Boes
Tom Lane wrote: Jeff Boes <[EMAIL PROTECTED]> writes: It appears that the rule is inserting the row copies into job_queue_trace with a job_id value that is one higher than the job_id from the original row. Almost as though it was re-evaluating the sequence ... No kidding. A rul

[GENERAL] Rule uses wrong value

2004-10-12 Thread Jeff Boes
(I thought I posted this yesterday from Google Groups, but it doesn't appear to have "taken".) I'm having a problem with a rule designed to log new rows inserted into one table. The base table is very volatile; rows are inserted from various places, including both application code and triggers.

Re: [GENERAL] HOWTO: Get a table or database definition

2004-09-07 Thread Jeff Boes
Google Mike wrote: I guess it would be great if Pgsql had a way to find a database definition via a system stored procedure like other database platforms have. There are a few: nexcerpt=# \df pg_get*def List of functions Result data type | Schema | Name

[GENERAL] Ranking values within a query (pseudo-ROWNUM) **fixed**

2004-06-24 Thread Jeff Boes
IF curr_grp IS NULL THEN curr_grp = t.the_group; ELSIF curr_grp != t.the_group THEN curr_grp = t.the_group; rank = 1; END IF; r.rank_of = rank; r.the_value = t.the_value; RETUR

[GENERAL] Ranking values within a query (pseudo-ROWNUM)

2004-06-24 Thread Jeff Boes
y field1') order by rank_of; which will give you the rank number and original value of each row. The second function is more interesting, because that's where you get the ability to do "top N by X" kinds of queries. For instance, select field1, field2, field3 fro

Re: [GENERAL] Timestamp precision and rounding

2004-06-07 Thread Jeff Boes
Stephan Szabo wrote: On Thu, 3 Jun 2004, Jeff Boes wrote: (asked last week on .questions, no response) Can anyone explain why this happens? (under 7.4.1) select '2004-05-27 09:00:00.51-04' :: timestamp(0) ; timestamp - 2004-05-27 09:00:01

Re: [GENERAL] Interpreting vacuum verbosity

2004-05-07 Thread Jeff Boes
ow much beer would we have to provide to get you to talk? 8-) -- Jeff Boes vox 269.226.9550 ext 24 Database Engineer fax 269.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com

[GENERAL] Bug in adddepend (was: pg_constraint missing many entries?)

2003-11-18 Thread Jeff Boes
t the end of the day. Overnight, we ran a few HUNDRED THOUSAND queries against a large table using no index ... -- Jeff Boes vox 269.226.9550 ext 24 Database Engineer fax 269.349.9076 Nexcerpt, Inc.

Re: [GENERAL] Table partitioning for maximum speed?

2003-10-10 Thread Jeff Boes
Bruno Wolff III wrote: On Fri, Oct 10, 2003 at 11:27:50 -0400, Jeff Boes <[EMAIL PROTECTED]> wrote: Yes, the table has: Table "public.link_checksums" Column | Type | Modifiers -+---+--- md5 | character(32) | not null link_id | int

[GENERAL] Fox Trot bows to us

2003-09-15 Thread Jeff Boes
http://www.ucomics.com/foxtrot/2003/09/14/ -- Jeff Boes vox 269.226.9550 ext 24 Database Engineer fax 269.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com ...Nexcerpt... Extend your

Re: [GENERAL] Cache lookup failed?

2003-08-18 Thread Jeff Boes
>= 0 and t.oid = a.atttypid order by 1 This is happening inside DBD::Pg, the "table_attributes" method. The relname being selected is NOT a temp table. We do make extensive use of temp tables in the code, however. -- Jeff Boes

Re: [GENERAL] Cache lookup failed?

2003-08-18 Thread Jeff Boes
there, I can't keep them straight ... 8-} I'd turn on query logging, but since we're getting these about every 3-7 days, I'm not sure that would be the most effective use of all that disk ... maybe I can find a way to localize it to the point where the

[GENERAL] Cache lookup failed?

2003-08-18 Thread Jeff Boes
31072 max_fsm_pages = 35 max_fsm_relations = 200 wal_buffers = 32 sort_mem = 65536 vacuum_mem = 65536 effective_cache_size = 196608 -- Jeff Boes vox 269.226.9550 ext 24 Database Engineer fax 269.349.9076 Nexcerpt

[GENERAL] Loading, but not running a query

2001-08-20 Thread Jeff Boes
Is there an equivalent to '\i' that will load up the query buffer but not run the query? (I have a query stored in a file that I want to modify on the fly, but not overwrite the query file.) -- Jeff Boes vox 616.226.9550 Databas

Re: [GENERAL] COPY with default values?

2001-05-25 Thread Jeff Boes
NSERT INTO keywords (key_text) VALUES ('foo'); It's been a while, but I'm pretty sure Oracle will do the same thing for each of these inserts, namely apply a default value when a null is detected. But thanks for the help! -- Jeff Boes

[GENERAL] COPY with default values?

2001-05-25 Thread Jeff Boes
n tried creating a view on keywords that has only keyword_text, and copying into THAT--no luck. Then I wrote a rule to replace inserts on the view with inserts on the table, but apparently COPY doesn't trigger INSERT rules. Grumble... -- Jeff Boes

[GENERAL] pl-perl setup?

2001-05-25 Thread Jeff Boes
Hello, I'm fairly new to PostgreSQL. Does anyone have a resource for setting up plperl from scratch? The online documentation doesn't offer much help. -- Jeff Boes vox 616.226.9550 Database Engineer fax 61

[GENERAL] Foreign key constraint generates unique index?

2001-05-18 Thread Jeff Boes
r table 'dogs' NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s) CREATE Why is Postgresql creating a unique index for 'dogs_owner_id_key'? I don't want that column to be unique! -- Jeff Boes