Re: [SQL] Fw: How to FindNearest

2006-10-03 Thread Bruno Wolff III
On Tue, Oct 03, 2006 at 17:35:55 +, [EMAIL PROTECTED] wrote: > > My function will take all the above info about the hole and down_hole_survey > tables, and sample.hole_id and sample.depth_meters and will calculate the > coordinates. I need to put these coordinates into sample.x , sample.y

Re: [SQL] timestamps over the web - suggestions

2006-10-03 Thread ljb
[EMAIL PROTECTED] wrote: > > My server is based MST, but web clients from Maine to Hawaii, and they wish > to see timestamps based in their own locale. > > Can anyone tell me how they're handling this? (sorry - can't get rid of my > clients) Here's a bit of JavaScript that might work for you. I

Re: [SQL] timestamps over the web - suggestions

2006-10-03 Thread Aaron Bono
You should probably handle this at the application level.  How you go about it will depend on what programming language you use.If you don't like that, check out the timezone function: http://www.postgresql.org/docs/8.0/static/runtime-config.html#GUC-TIMEZONESee also for an example:http://www.varle

[SQL] formatting intervals with to_char

2006-10-03 Thread Graham Davis
Hi, I'm trying to format the output of a time interval so that it displays as HH:MM:SS no matter how many days it spans. So for instance, an interval of 2 days 4 hours and 0 minutes would look something like "52:00:00". The documentation for to_char states that: "|to_char(interval)| format

[SQL] timestamps over the web - suggestions

2006-10-03 Thread chester c young
My server is based MST, but web clients from Maine to Hawaii, and they wish to see timestamps based in their own locale.Can anyone tell me how they're handling this?  (sorry - can't get rid of my clients) Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail.

Fw: [SQL] How to FindNearest

2006-10-03 Thread paallen
I guess I explained that very poorly. Sorry. It is actually much simplier. I have 3 tables Hole Hole_id X Y Z Down_hole_survey Hole_id Depth_meters Azimuth Vertical_inclination X Y Z Sample Hole_id Depth_meters X Y Z Hole_id is a primary key in the hole table

[SQL] Updating from table with multiple possibilities

2006-10-03 Thread Worky Workerson
I have two tables, ips and ranges, where ips contains a list of ips (INET) and ranges contains a list of ip blocks (CIDR), ala: CREATE TABLE ips (ip INET, info varchar); CREATE TABLE ranges (range CIDR, info varchar); I would like to update the info column in ips to be the info column of the mos

Re: [SQL] Update 3 columns w/ 1 function calc 3 values?

2006-10-03 Thread Bruno Wolff III
On Tue, Oct 03, 2006 at 14:55:55 +, [EMAIL PROTECTED] wrote: > My function was made to return coordinates, X,Y,Z > for a point along a curved line. So it is not the > fastest of functions because it has to call and > query data from 3 different tables. I used to > > What should I do to spe

Re: [SQL] How to FindNearest

2006-10-03 Thread Bruno Wolff III
On Tue, Oct 03, 2006 at 14:43:40 +0300, Alexander Ilyin <[EMAIL PROTECTED]> wrote: > > Thank you for your great idea. But how it can be used for positioning the > cursor in the already existed ResultSet? Using your idea I can found the > closest to targetvalue row but not its position in my Re

Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-03 Thread chrisj
Brilliant, elegant and simple !! I can't wait to try it (don't have access to Postgres 9-5 EDT) !! thank-you !! Andrew Sullivan wrote: > > On Tue, Oct 03, 2006 at 07:26:52AM -0700, chrisj wrote: >> location, but they are the directive to all store locations saying: "In >> the >> context of

Re: [SQL] Update 3 columns w/ 1 function calc 3 values?

2006-10-03 Thread William Leite Araújo
2006/10/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Hi all,I am moving some of my old MS Access functions toplpgsql.My function was made to return coordinates, X,Y,Zfor a point along a curved line.  So it is not thefastest of functions because it has to call and query data from 3 different tables.  I

[SQL] Update 3 columns w/ 1 function calc 3 values?

2006-10-03 Thread paallen
Hi all, I am moving some of my old MS Access functions to plpgsql. My function was made to return coordinates, X,Y,Z for a point along a curved line. So it is not the fastest of functions because it has to call and query data from 3 different tables. I used to just create 3 wrapper functions fo

Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-03 Thread Andrew Sullivan
On Tue, Oct 03, 2006 at 07:26:52AM -0700, chrisj wrote: > location, but they are the directive to all store locations saying: "In the > context of the timezone your store is located in, these are the hours you > should be open. Ah. Well, then, right, it _does_ have to be timezone free. That's a

Re: [SQL] SEQUENCES

2006-10-03 Thread Bruno Wolff III
On Mon, Oct 02, 2006 at 13:39:38 -0300, Rodrigo Sakai <[EMAIL PROTECTED]> wrote: > Hi all, > > > > I need to get all sequences and their respective current values! Is there > any catalog table or any other away to get this??? You can get their names from pg_class (with relkind = 'S') and

Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-03 Thread chrisj
Hi Andrew, I do appreciate your reply and we agree on two things timestamp without timezone should be avoided and the timestamps in table 2 should definately be "with timezone". I have no problem changing the timestamps in table 1 to "with timezone", but I do not see how this solves my problem (

Re: [SQL] Assigning a timestamp without timezone to a timestamp with timezone

2006-10-03 Thread Andrew Sullivan
On Mon, Oct 02, 2006 at 08:15:56PM -0700, chrisj wrote: > Two tables both the have open and close columns that are timestamp or > timestamp with time zone. I think the best answer is to convert the one table to timestamptz, and always enter explicitly the time zone with it (since you're going to k

Re: [SQL] i have table

2006-10-03 Thread Daryl Richter
On 10/3/06 6:47 AM, "Penchalaiah P." <[EMAIL PROTECTED]> wrote: > > Hi ... > > I have one table with 12 fields.. > > > now I want to add one more field in this table.. but that field has to > come next to cda_no.. I mean as a 3rd field.. If I am adding that field > it is coming last field ...

Re: [SQL] How to FindNearest

2006-10-03 Thread Alexander Ilyin
-Original Message- From: Bruno Wolff III <[EMAIL PROTECTED]> To: Alexander Ilyin <[EMAIL PROTECTED]> Date: Mon, 2 Oct 2006 19:20:49 -0500 Subject: Re: How to FindNearest > On Sat, Sep 30, 2006 at 11:43:40 +0300, > Alexander Ilyin <[EMAIL PROTECTED]> wrote: > > > > Suppose we have huge

Re: [SQL] i have table

2006-10-03 Thread Achilleas Mantzios
Στις Τρίτη 03 Οκτώβριος 2006 13:47, ο/η Penchalaiah P. έγραψε: > Hi ... > > I have one table with 12 fields.. > > > > CREATE TABLE addition_alteration_memo > > ( > > addition_alteration_memo int8 NOT NULL DEFAULT > nextval('addition_alteration_memo_addition_alteration_memo_seq'::regclas > s), > >

Re: [SQL] i have table

2006-10-03 Thread A. Kretschmer
am Tue, dem 03.10.2006, um 16:17:30 +0530 mailte Penchalaiah P. folgendes: > now I want to add one more field in this table.. but that field has to come > next to cda_no.. I mean as a 3^rd field.. If I am adding that field it is > coming last field ? Yes. > > may I know how it is possible to th

[SQL] i have table

2006-10-03 Thread Penchalaiah P.
Hi … I have one table with 12 fields..   CREATE TABLE addition_alteration_memo (   addition_alteration_memo int8 NOT NULL DEFAULT nextval('addition_alteration_memo_addition_alteration_memo_seq'::regclass),   cda_no varchar(7) NOT NULL,   week numeric,   sheet_no numeric,   serial_