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 at 04:38

Re: [SQL] Index lookup on > and < criteria

2005-11-01 Thread Michael Fuhr
On Tue, Nov 01, 2005 at 03:21:21PM -0600, David Durham wrote: > sipcdr=# explain analyze select * from october_cdr_call where begin_time > >= '10/1/2005' and begin_time < '10/4/2005'; > > QUERY PLAN > > >

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

2005-11-01 Thread Michael Fuhr
On Tue, Nov 01, 2005 at 04:38:12PM -0500, Lane Van Ingen wrote: > 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(). > ... > CREATE OR REPLACE F

Re: [SQL] Nested Table in PostgreSQL or some alternative Variants

2005-11-01 Thread Jim C. Nasby
What do you mean by 'nested table'? Maybe arrays will do what you want? Typically (and this applies to other databases as well), this is done using two tables and refferential integrity. IE: CREATE TABLE purchase_order( po_id serial CONSTRAINT purchase_order__po_id PRIMARY KEY

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Tom Lane
"Mark R. Dingee" <[EMAIL PROTECTED]> writes: > md5 works, but I've been able to > brute-force crack it very quickly, Really? Where's your publication of this remarkable breakthrough? regards, tom lane ---(end of broadcast)

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Mark R. Dingee
Bruno, I use an authenticate() function as a part of state maintenance in a PHP web app. In the function, I generate an encrypted token that is then used in the validation process on subsequent pages. md5 works, but I've been able to brute-force crack it very quickly, so I'm looking for an al

[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

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Mark R. Dingee
I'll check it out. Thanks, Josh On Tuesday 01 November 2005 02:49 pm, Josh Berkus wrote: > Mark, > > > I'm in need of a one-way pgsql script that will take a plain-text string > > and return an ecrypted string (preferably 32 character) . I've been > > using md5('string'), but I'm concerned it's

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Bruno Wolff III
On Tue, Nov 01, 2005 at 14:38:05 -0500, "Mark R. Dingee" <[EMAIL PROTECTED]> wrote: > Everyone, > > I'm in need of a one-way pgsql script that will take a plain-text string and > return an ecrypted string (preferably 32 character) . I've been using > md5('string'), but I'm concerned it's too

Re: [SQL] Index lookup on > and < criteria

2005-11-01 Thread David Durham
Michael Fuhr wrote: No need to guess: run the queries with enable_seqscan disabled and see if an index scan is indeed faster. select max(myTimeStamp) from myTable; In current releases min() and max() can't use indexes; search the archives for numerous discussions of the reasons. The work

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Josh Berkus
Mark, > I'm in need of a one-way pgsql script that will take a plain-text string > and return an ecrypted string (preferably 32 character) . I've been > using md5('string'), but I'm concerned it's too weak for my needs. Does > anyone have any recommendations? You check out pgcrypto in /contrib

[SQL] PGSQL encryption functions

2005-11-01 Thread Mark R. Dingee
Everyone, I'm in need of a one-way pgsql script that will take a plain-text string and return an ecrypted string (preferably 32 character) . I've been using md5('string'), but I'm concerned it's too weak for my needs. Does anyone have any recommendations? Thanks, Mark

Re: [SQL] Index lookup on > and < criteria

2005-11-01 Thread Michael Fuhr
On Tue, Nov 01, 2005 at 12:18:19PM -0600, David Durham wrote: > Apologies if this questions is asked often. I'm doing some select > statements based on a timestamp field. I have an index on the field, > and when I use the '=' operator the index is used. However, if I use > the '>' or '<' oper

Re: [SQL] Index lookup on > and < criteria

2005-11-01 Thread A. Kretschmer
am 01.11.2005, um 12:18:19 -0600 mailte David Durham folgendes: > Apologies if this questions is asked often. I'm doing some select > statements based on a timestamp field. I have an index on the field, and > when I use the '=' operator the index is used. However, if I use the '>' > or '<' o

[SQL] Index lookup on > and < criteria

2005-11-01 Thread David Durham
Apologies if this questions is asked often. I'm doing some select statements based on a timestamp field. I have an index on the field, and when I use the '=' operator the index is used. However, if I use the '>' or '<' operators, then it does a full table scan. I've got around 6 million row

Re: [SQL] [GENERAL] A Not Join

2005-11-01 Thread Jim C. Nasby
On Tue, Nov 01, 2005 at 04:27:01PM +0200, L van der Walt wrote: > I have three table: > Users - Contains username, ID etc... > Permissions - A permission name and ID > Link up table - The user.id and permission.id > > If a user.id and a permission.id row exists in the linkuptable the user > have

Re: Fwd: Re: [SQL] Referencing

2005-11-01 Thread Daryl Richter
[EMAIL PROTECTED] wrote: Quoting Daryl Richter <[EMAIL PROTECTED]>: [EMAIL PROTECTED] wrote: > Quoting Daryl Richter <[EMAIL PROTECTED]>: >> It's hard to say without knowing more precisely what you are trying to >> model, but I think this push you in the right direction: >> > Okay, but referenc

[SQL] A Not Join

2005-11-01 Thread L van der Walt
I have three table: Users - Contains username, ID etc... Permissions - A permission name and ID Link up table - The user.id and permission.id If a user.id and a permission.id row exists in the linkuptable the user have that permission granted. With the statement below I can see the permissions