Re: [SQL] Trees: maintaining pathnames

2002-11-22 Thread Josh Berkus
Dan, Looks good to me. It's the same thing I do for the Celko tree structures in one application -- I have a cache table holding such things as level and parent_id for each node, values which can only be generated from the source tables through slow aggregates. Also, the use of a child table to

Re: [SQL] Trees: maintaining pathnames

2002-11-22 Thread Dan Langille
On 17 Nov 2002 at 11:39, Dan Langille wrote: > My existing tree implementation reflects the files contained on disk. > The full pathname to a particlar file is obtained from the path to the > parent directory. I am now considering putting this information into > a field in the table. > > Attach

Re: [SQL] Trees: maintaining pathnames

2002-11-22 Thread Dan Langille
On 20 Nov 2002 at 15:20, Dan Langille wrote: > On 17 Nov 2002 at 14:51, Josh Berkus wrote: > > > Dan, > > > > > My existing tree implementation reflects the files contained on > > > disk. > > > The > > > full pathname to a particlar file is obtained from the path to the > > > parent directory.

Re: [SQL] escape single quote in INSERT command

2002-11-22 Thread Jeff Boes
On Fri, 22 Nov 2002 08:00:01 -0500, Hunter wrote: > I have a perl application for a registration form. I'd like to put > escape characters in my insert command to accommodate for ' (i.e. > O'Brien, O'Malley, etc). I've tired double quotes, single quotes, back > tick, forward ticks, curly bracket,

Re: [SQL] calculating interval

2002-11-22 Thread Jeff Boes
On Fri, 22 Nov 2002 09:26:31 -0500, praveen vejandla wrote: > Dear All, > > Is there any way in postgresql to calculate the interval between two > times excluding specific days,specific duration. > > Ex: > timestamp1 : 2002-10-01 10:30AM > timestamp2 : 2002-15-01 04:50PM > > suppose if i need

Re: [SQL] calculating interval

2002-11-22 Thread Jean-Luc Lachance
Watch out! 36.85 weeks could have 37 sundays... Take into account the day of the week of the first and last day. Also, process the first and last day separately and work with whole day, if you want to exclude part of the day. Dan Langille wrote: > > On 22 Nov 2002, praveen vejandla wrote: >

Re: [SQL] Date trunc in UTC

2002-11-22 Thread Tom Lane
Thrasher <[EMAIL PROTECTED]> writes: > The biggest point that I see is that it would be nice to have some kind > of function that works with UTC values, regarding of which timezone the > user has set. You can do that in 7.3, using the AT TIME ZONE construct. Observe: regression-# begin; BEGIN

Re: [SQL] calculating interval

2002-11-22 Thread Dan Langille
On 22 Nov 2002, praveen vejandla wrote: > Dear All, > > Is there any way in postgresql to calculate the interval between > two times excluding specific days,specific duration. > > Ex: > timestamp1 : 2002-10-01 10:30AM > timestamp2 : 2002-15-01 04:50PM > > suppose if i need the difference between

[SQL] calculating interval

2002-11-22 Thread praveen vejandla
Dear All, Is there any way in postgresql to calculate the interval between two times excluding specific days,specific duration. Ex: timestamp1 : 2002-10-01 10:30AM timestamp2 : 2002-15-01 04:50PM suppose if i need the difference between timestamp1,timestamp2 but i don't want to count how many

Re: [SQL] connectby questions

2002-11-22 Thread Dan Langille
On Fri, 22 Nov 2002, Dan Langille wrote: > Here is the actual data for the above nodes: > > freshports=# select * from element where id in (104503, 104504, 104505); >id | name | parent_id | directory_file_flag | status > +--+---+-+-

Re: [SQL] Date trunc in UTC

2002-11-22 Thread Thrasher
The biggest point that I see is that it would be nice to have some kind of function that works with UTC values, regarding of which timezone the user has set. Let's say, something like SELECT UTC_DATE_TRUNC ('month', NOW ()); utc_date_trunc 2002-11-01 01:00:00+01