Re: [SQL] User input in psql

2005-11-02 Thread Richard Huxton
Ashok Agrawal wrote: Hi . Just wanted to know what is equivalent of "Oracle &" in postgresql. select count(*) from table1 where id =&1 where sqlplus plus will prompt to enter value for 1. I would like to do the same in psql. There isn't an equivalent feature, I'm afraid. There are variables y

[SQL] User input in psql

2005-11-02 Thread Ashok Agrawal
Hi . Just wanted to know what is equivalent of "Oracle &" in postgresql. select count(*) from table1 where id =&1 where sqlplus plus will prompt to enter value for 1. I would like to do the same in psql. Thanks Ashok ---(end of broadcast)--- TIP

Re: [SQL] Poor performance in inet << cidr join (Resolved)

2005-11-02 Thread Tom Lane
Axel Rau <[EMAIL PROTECTED]> writes: > Question: Can rtree_inet be included in the core? No, because rtree is going away in 8.2. Feel like converting that code to be a GIST opclass, instead? regards, tom lane ---(end of broadcast)-

Re: [SQL] Poor performance in inet << cidr join (Resolved)

2005-11-02 Thread Axel Rau
Am 31.10.2005 um 19:53 schrieb Axel Rau: The planner does not use the pk-indices. Poking around, I could not find an operator class, which supports the containment ('<<') operator. Is my conclusion correct? How can the functionality be extended? Is there any implementation available? rtree_inet

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Bruno Wolff III
On Wed, Nov 02, 2005 at 16:01:19 -0500, "Mark R. Dingee" <[EMAIL PROTECTED]> wrote: > Thanks Bruno. I'm using a hash so I can merge info available in the HTTPS > header with data I store on the server so that the hash can be reconstructed > during the validation process from the raw elements.

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Mark R. Dingee
Thanks Bruno. I'm using a hash so I can merge info available in the HTTPS header with data I store on the server so that the hash can be reconstructed during the validation process from the raw elements. Tom Lane reminded me of using random seeds similar to what you are suggesting. I think I

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

2005-11-02 Thread David Durham
Yeah, analyze did make a difference. See below. -- Index Scan using october_begin_time on october_cdr_call (cost=0.00..98383.82 r ows=24594 width=568) (actual time=0.280..79274.579 rows=538592 loops=1) Index Cond: ((beg

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Bruno Wolff III
On Tue, Nov 01, 2005 at 17:00:50 -0500, "Mark R. Dingee" <[EMAIL PROTECTED]> wrote: > 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

Re: [SQL] function, that uses different table(names)

2005-11-02 Thread Tom Lane
Moritz Bayer <[EMAIL PROTECTED]> writes: > I've a bunch of tables, which have just about the same name. They are just > iterated like this: > tbl_table1 > tbl_table2 > tbl_table3 > ... > They all have the same field, but different data. > Now I'm wondering, if I have to write functions for every

[SQL] Function with dynamic command (EXECUTE) not working

2005-11-02 Thread Robert Blixt
Hello, I am trying to create a function that will allow me to dynamically choose the ORDER BY sequence. I also want the result of the SELECT statement to be returned. Far as I can tell this can not be done with EXECUTE alone rather I should use FOR .. IN EXECUTE. The result of the statement is

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Tom Lane
"Mark R. Dingee" <[EMAIL PROTECTED]> writes: > The script I'm using to "break" md5 presumes that the cracker knows the 3 > elements being concatenated together to form the plain-text sting which is > then passed into md5. The method I'm using then begins running through > various permutations.

Re: [SQL] function, that uses different table(names)

2005-11-02 Thread Moritz Bayer
Thanks, great thing! Since I have an select statement, I'll have to use a cursor. Just as execute I haven't used it before. So I can say that I've learned something today :) Thaks again, Moritz

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Neil Saunders
OK, you're not really "breaking" md5. If the attacker already knows the information being encrypted, then all you're testing is the concatenation order- Surely the information is more important than the order? md5 is a one way hash function, and so using an alternate algorithm will provide no benef

Re: [SQL] function, that uses different table(names)

2005-11-02 Thread A. Kretschmer
am 02.11.2005, um 14:36:06 +0100 mailte Moritz Bayer folgendes: > live_table := ''tbl_highscore_app'' || cast($1 as varchar); > SELECT i_return = max(userid) FROM ''tbl_highscore_app'' || cast($1 as > varchar); > > My parser tells me that this is not possible. Correct. You should build your stri

Re: [SQL] function, that uses different table(names)

2005-11-02 Thread A. Kretschmer
am 02.11.2005, um 14:30:38 +0100 mailte Moritz Bayer folgendes: > Hello group, > > I've a bunch of tables, which have just about the same name. They are just > iterated like this: > > tbl_table1 > tbl_table2 > tbl_table3 > ... > > They all have the same field, but different data. > > Now I'm w

Re: [SQL] function, that uses different table(names)

2005-11-02 Thread Moritz Bayer
Sorry, pushed the send - button  by accident. So here is the right text: CREATE OR REPLACE function getmaxuserid(integer) RETURNS integer AS' DECLARE live_table varchar(100);   DECLARE i_return integer; BEGIN live_table := ''tbl_highscore_app'' || cast($1 as varchar); SELECT

[SQL] function, that uses different table(names)

2005-11-02 Thread Moritz Bayer
Hello group, I've a bunch of tables, which have just about the same name. They are just iterated like this: tbl_table1 tbl_table2 tbl_table3 ... They all have the same field, but different data. Now I'm wondering, if I have to write functions for every table,  although they perform the same ope

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Mark R. Dingee
Mike & Tom, The script I'm using to "break" md5 presumes that the cracker knows the 3 elements being concatenated together to form the plain-text sting which is then passed into md5. The method I'm using then begins running through various permutations. Do you believe that the methodology is

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Mario Splivalo
On Tue, 2005-11-01 at 17:13 -0500, Tom Lane wrote: > "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? I'd say you can't bruteforce md5, unless you're ext