Re: [SQL] How to Force Transactions to Process Serially on A Table

2005-12-19 Thread Lane Van Ingen
to wait in line to be processed serially, and that it only lasts as long as the pl/pgsql transaction block or the next COMMIT. -Original Message- From: Achilleus Mantzios [mailto:[EMAIL PROTECTED] Sent: Monday, December 19, 2005 9:25 AM To: Lane Van Ingen Cc: pgsql-sql@postgresql.org Subject

[SQL] How to Force Transactions to Process Serially on A Table

2005-12-19 Thread Lane Van Ingen
I am using PL/SQL functions on Windows 2003, version 8.0.1. I have not used explicit PostgreSQL LOCKing before, but I need some advice on how properly to use some explicit locking. I think that duplicate key violations I am now getting are the result. I want to force transactions being used to up

Re: [SQL] Database with "override" tables

2005-12-06 Thread Lane Van Ingen
s, provide DEFAULT values). Will that help? -Original Message- From: Michael Burke [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 9:55 AM To: Lane Van Ingen Cc: PGSQL-SQL Subject: Re: [SQL] Database with "override" tables Lane Van Ingen wrote: >I think I h

Re: [SQL] Database with "override" tables

2005-12-05 Thread Lane Van Ingen
I think I have a similar situation involving the naming of assets, where the usual asset description is used, but users can enter a description in a separate table which 'overrides' the original name with a name that is more familiar to the individual. IF THIS IS WHAT YOU WANT, it was accomplishe

Re: [SQL] How to Log SELECT Statements Having Errors

2005-11-15 Thread Lane Van Ingen
is discussed: http://www.postgresql.org/docs/8.0/static/runtime-config.html#RUNTIME-CONFIG -LOGGING -Original Message- From: Magnus Hagander [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 15, 2005 3:53 AM To: Lane Van Ingen; pgsql-sql@postgresql.org Subject: RE: [SQL] How to Log SELECT Stat

[SQL] How to Log SELECT Statements Having Errors

2005-11-14 Thread Lane Van Ingen
We are putting a new application on PostgreSQL 8.0.1 (Windows 2003); we are coming off of MySQL, and are having a hard time finding all of the offending SQL calls. It would help a great deal if I could log the content of any SQL calls that fail. Am only interested in SELECT statements. Noticed th

Re: [SQL] Can't Get SETOF Function to Work

2005-11-01 Thread Lane Van Ingen
It worked perfectly! Thank you so much for your help! -Original Message- From: Michael Fuhr [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 01, 2005 7:45 PM To: Lane Van Ingen Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Can't Get SETOF Function to Work On Tue, Nov 01, 2005

[SQL] Can't Get SETOF Function to Work

2005-11-01 Thread Lane Van Ingen
Have tried perhaps 20+ alternatives on this plpgsql function, but can't get it to work. Suspect I have done something wrong either with RETURN values, creating of a type, or (most likely) use of ROW(). I am trying to fix the returned rows from enclosing reults in parenthesis; found a similar incid

[SQL] What Am I Doing Wrong?

2005-10-18 Thread Lane Van Ingen
I have been trying to subtract two timestamps from each other to determine the difference between the two timestamps (current time and a past timestamp called 'updated_time') IN SECONDS, but no luck. The trouble I am having is getting the first timestamp, representing the current time, to translat

Re: [SQL] What Am I Doing Wrong?

2005-10-18 Thread Lane Van Ingen
Ignore my request. The solution is: --- computeIfUptime() - select (EXTRACT(EPOCH from TIMESTAMP 'now') - EXTRACT(EPOCH from TIMESTAMP '2005-10-18 17:00:00'))::integer -Original Message- From: Lane Van

[SQL] Can EXCEPT Be Used for To Solve This Problem?

2005-08-24 Thread Lane Van Ingen
Given the following data in a table named 'foo' : id update_time description 22005-08-24 00:10:00 transaction1 22005-08-24 00:22:00 transaction2 22005-08-24 00:34:00 transaction3 22005-08-24 00:58:00 transaction4 I want to select 2nd old

Re: [SQL] Why Doesn't SQL This Expression Work?

2005-08-22 Thread Lane Van Ingen
around it! Thanks again -Original Message- From: Dmitri Bichko [mailto:[EMAIL PROTECTED] Sent: Monday, August 22, 2005 4:42 PM To: Lane Van Ingen; pgsql-sql@postgresql.org Subject: RE: [SQL] Why Doesn't SQL This Expression Work? I believe the problem is that the expression is

[SQL] Why Doesn't SQL This Expression Work?

2005-08-22 Thread Lane Van Ingen
Hi, am trying to do a simple computation on two views, but for some reason the current_util_in computation always returns zero. All fields being used are integer. select a.if_id, a.in_count, a.time_incr, b.speed, ((a.time_incr * b.speed) / 8) as possible_bytes, (a.in_count /

Re: [SQL] SQL CASE Statements

2005-08-22 Thread Lane Van Ingen
Halley, here is a sample for you that might help; the purpose of this function was to set an indicator of '1' or '0' (true or false) on a router interface if the router interface ID was the same as the default gateway for the Router node ID: create view current_default_gateways_v (router_id, defau

[SQL] SQL CASE Statements

2005-08-18 Thread Lane Van Ingen
In the following CASE statement, is it possible to put a SELECT ... WHERE EXISTS in the of a CASE statement, and have it work? The I want to do is to yield a result of '1' if the statement finds the value 'a' in a table (EXISTS evaluates true), and '0' if it evaluates false ('a' not found). SEL

[SQL] Is it This Join Condition Do-Able?

2005-08-17 Thread Lane Van Ingen
Given three tables: a, b, c ; each consist of a 'keyfld' and a field called 'foo': tbl a tbl b tbl c - - - a.keyfldb.keyfld c.keyfld a.foo1 b.foo2 c.foo3 I want to always return all of tbl a; and I want to return b.fo

Re: [SQL] catch an 'update where false' ?

2005-08-15 Thread Lane Van Ingen
PROTECTED] Behalf Of santiago Sent: Sunday, August 14, 2005 9:13 AM To: pgsql-sql@postgresql.org Subject: Re: [SQL] catch an 'update where false' ? Hi thanks all for your answers ! to Lane Van Ingen: my purpose is to write a trigger on update so that 'users' might then us updat

[SQL] SQL Newbie

2005-08-12 Thread Lane Van Ingen
It seems to me that I should be able to do this, but after 5 hrs of trying, I can't figure this one out. I could do this in two queries, but seems like I should be able to do this in one. What I am trying to do: Find the highest speed at which each interface of a router has run over time. I have