Re: [SQL] C functions and int8?

2000-09-21 Thread Tom Lane
Forest Wilkinson <[EMAIL PROTECTED]> writes: > That's an int8 meaning "eight bit integer". I want to work with an int8 > meaning "64 bit integer", as described in the docs: > http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm#AEN942 > So how do I return one of these suckers from a

Re: [SQL] C functions and int8?

2000-09-21 Thread Forest Wilkinson
That's an int8 meaning "eight bit integer". I want to work with an int8 meaning "64 bit integer", as described in the docs: http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm#AEN942 So how do I return one of these suckers from a C function? Forest On Thu, 21 Sep 2000 10:32:50 +0

RE: [SQL] sql query not using indexes

2000-09-21 Thread Hiroshi Inoue
> -Original Message- > From: Sergio de Almeida Lenzi > > On Wed, 20 Sep 2000, Stephan Szabo wrote: > > > On Wed, 20 Sep 2000, User Lenzi wrote: > > > > > if I start a query: > > > > > > explain select * from teste where login = 'xxx' > > > results: > > > Index Scan using teste1 on teste

Re: [SQL] Convert from Seconds-Since-Epoch to Timestamp

2000-09-21 Thread Jie Liang
Hi, there, urldb=# create table foo(sec int4); CREATE urldb=# insert into foo values(54321); INSERT 382942319 1 urldb=# select interval(reltime (sec||'secs')) from foo; interval -- 15:05:21 (1 row) "Brian C. Doyle" wrote: > how would you do that with in a query? > > ie select date ,

Re: [SQL] Convert from Seconds-Since-Epoch to Timestamp

2000-09-21 Thread Brian C. Doyle
how would you do that with in a query? ie select date , interval(reltime 'table.secs'); when the value in table.secs = 54321 and "secs" is not a part of it? At 11:35 AM 9/21/00 -0700, Jie Liang wrote: >Hi, Webb, > >I am not quit sure what you really want to do, however, I assume that >following

Re: [SQL] Convert from Seconds-Since-Epoch to Timestamp

2000-09-21 Thread Jie Liang
Hi, Webb, I am not quit sure what you really want to do, however, I assume that following maybe what you mean: db=# select interval(reltime '12313221 secs'); interval 4 mons 22 12:20:21 (1 row) Webb Sprague wrote: > Hi all, > > How do I convert from seconds (an in

[SQL] Convert from Seconds-Since-Epoch to Timestamp

2000-09-21 Thread Webb Sprague
Hi all, How do I convert from seconds (an integer) to timestamp? I am sure it is easy, but I can't find it in the docs, so far. Thanks Webb __ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/

Re: [Fwd: Re: [SQL] no ORDER BY in subselects?]

2000-09-21 Thread Philip Warner
At 11:50 21/09/00 -0400, Frank Bax wrote: >At 11:29 AM 9/21/00 +1000, you wrote: >>The main reason I use them is to find the 'next' or 'previous' record in a >>list (eg. next date, next ID). eg. >> >> select , (select ID from table where id > this.id >> order by id asc limit 1) as next_id ... >

Re: [SQL] Multiple Index's

2000-09-21 Thread Brian C. Doyle
See if this help the table has userid | date | helped_customers An employ will enter in their userid, the date and how many customer they helped that day. What I want to do is prevent the employees from enter the data more than once a day At 10:28 AM 9/21/00 -0700, Mitch Vincent wrote: > >

Re: [SQL] Multiple Index's

2000-09-21 Thread Mark Volpe
CREATE TABLE user_info(user_id name, entry_date date, info text); CREATE UNIQUE INDEX user_info_key ON user_info(user_id, entry_date); "Brian C. Doyle" wrote: > > Hello all, > > How would I prevent a user from submitting information to a table once they > have already done so for that day. I w

Re: [SQL] Multiple Index's

2000-09-21 Thread Stephan Szabo
On Thu, 21 Sep 2000, Brian C. Doyle wrote: > Hello all, > > How would I prevent a user from submitting information to a table once they > have already done so for that day. I would need them to be able > information on future dates as well as have information in the table from > past dates

Re: [SQL] sql query not using indexes

2000-09-21 Thread Stephan Szabo
On Thu, 21 Sep 2000, Sergio de Almeida Lenzi wrote: > > > On a machine running version 6.5 both queries results index scan. > > > > > > this results that the version 6.5 is faster than version 7.0.2 on this > > > kind of > > > query. > > > > > > > > > Any explanation??? > > > > Have you done

Re: [SQL] Multiple Index's

2000-09-21 Thread Mitch Vincent
> Hello all, > > How would I prevent a user from submitting information to a table once they > have already done so for that day. The best you could probably do is to go back and delete undesired recoords at the end of the day because if it is as you said, they've already put the information into

[SQL] Multiple Index's

2000-09-21 Thread Brian C. Doyle
Hello all, How would I prevent a user from submitting information to a table once they have already done so for that day. I would need them to be able information on future dates as well as have information in the table from past dates from that user. I am looking for something like insert u

Re: [Fwd: Re: [SQL] no ORDER BY in subselects?]

2000-09-21 Thread Frank Bax
At 11:29 AM 9/21/00 +1000, you wrote: >The main reason I use them is to find the 'next' or 'previous' record in a >list (eg. next date, next ID). eg. > > select , (select ID from table where id > this.id > order by id asc limit 1) as next_id ... Doesn't this give the same result (without order

Re: [SQL] sql query not using indexes

2000-09-21 Thread Sergio de Almeida Lenzi
On Wed, 20 Sep 2000, Stephan Szabo wrote: > On Wed, 20 Sep 2000, User Lenzi wrote: > > > if I start a query: > > > > explain select * from teste where login = 'xxx' > > results: > > Index Scan using teste1 on teste (cost=0.00..97.88 rows=25 ) > > > > > > however a query: > > explain selec

Re: [SQL] C functions and int8?

2000-09-21 Thread Karel Zak
On Thu, 21 Sep 2000, Forest Wilkinson wrote: > I have written a few Postgres extension functions in C, and want to modify > some of them to return an int8. However, I don't see any int8 definition > in postgres.h. (I have the 7.0.2 RPMs installed.) How should I > accomplish this? in the sou

[SQL] C functions and int8?

2000-09-21 Thread Forest Wilkinson
I have written a few Postgres extension functions in C, and want to modify some of them to return an int8. However, I don't see any int8 definition in postgres.h. (I have the 7.0.2 RPMs installed.) How should I accomplish this?