Re: [SQL] Changing user passwords

2000-08-08 Thread Nagy Laszlo Zsolt , KLTE TTK pm1

> Is it possible to change a user's password without using the pg_passwd
> command?
> For example, how does a user changes his password from the interactive
> monitor?

See the following commands:

CREATE USER
ALTER USER
CREATE GROUP
ALTER GROUP

For example:

ALTER USER user1 WITH PASSWORD 'password1';

Please note thatuser passwords cannot be changed in a transaction. ( 7.0.2
)

 Laci 1.0




Re: [SQL] Changing user passwords

2000-08-08 Thread Rob van der Leek

A question about the ALTER USER command I couldn't find in the 
standard documentation:

- How do I assign an 'undefined' password?

ALTER USER nobody WITH PASSWORD "";

works, but doesn't assign an undefined password to nobody (like the
`pg_passwd nobody` command would do).

DROP USER nobody; CREATE USER nobody;

doesn't do the job either.

And why does the ALTER USER command operates on pg_shadow instead of
pg_passwd? (or is this configurable?)

rob.

- 

"Nagy Laszlo Zsolt , KLTE TTK pm1" wrote:
> 
> > Is it possible to change a user's password without using the pg_passwd
> > command?
> > For example, how does a user changes his password from the interactive
> > monitor?
> 
> See the following commands:
> 
> CREATE USER
> ALTER USER
> CREATE GROUP
> ALTER GROUP
> 
> For example:
> 
> ALTER USER user1 WITH PASSWORD 'password1';
> 
> Please note thatuser passwords cannot be changed in a transaction. ( 7.0.2
> )
> 
>  Laci 1.0

-- 
Rob van der Leek
E-mail: [EMAIL PROTECTED]

FROG Navigation Systems b.v.
Cartesiusweg 120
3534 BD Utrecht
Tel. 030-2440550
Fax. 030-2440700
http://www.frog.nl




[SQL] returning a recordset with pl/pgsql

2000-08-08 Thread Keith Wong

Hi everyone,

I'm using postgresql with php4. I wanted to write a stored procedure to 
return a recordset (using pl/pgsql). From what I've read from the 
documentation it seems like you can only returned postgres types like 
strings, booleans, etc.

Is it possible to return recordsets using pl/pgsql?
If so, how do I declare the return type in the declaration?

Thanks in advance.

Cheers,
Keith.




Re: [SQL] Changing user passwords

2000-08-08 Thread Bernie Huang

Rob van der Leek wrote:

> A question about the ALTER USER command I couldn't find in the
> standard documentation:
>
> - How do I assign an 'undefined' password?
>
> ALTER USER nobody WITH PASSWORD "";
>
> works, but doesn't assign an undefined password to nobody (like the
> `pg_passwd nobody` command would do).
>
> DROP USER nobody; CREATE USER nobody;
>
> doesn't do the job either.
>
>

There is no space between:

eg; createuser whoever; dropuser whoever;


- Bernie


begin:vcard 
n:Huang;Bernie
tel;fax:(604)664-9195
tel;work:(604)664-9172
x-mozilla-html:TRUE
org:Environment Canada;Standards and Technology Services
adr:;;700-1200 West 73 Ave.;Vancouver;BC;V6P 6H9;Canada
version:2.1
email;internet:[EMAIL PROTECTED]
title:Programmer
x-mozilla-cpt:;0
fn:Bernie Huang
end:vcard



Re: [SQL] Functions too slow, even with iscachable?

2000-08-08 Thread Ang Chin Han

On Mon, Aug 07, 2000 at 10:58:27AM -0400, Tom Lane wrote:

> (I assume the lack of "survey_id =" here is just a cut-and-paste error?)

Yup. :)

> I think what you're getting bit by is that the optimizer doesn't
> recognize "var = function(param)" as being a potential indexscan clause.
> Does EXPLAIN show that the first query is producing an indexscan plan?

It did. I'll try to make up a reproducible test case, if you need
it.

> I have not tried it, but I think you could get around this problem in
> plpgsql, along the lines of
>   tmp1 = ticket2name($1);
>   tmp2 = ticket2survey_id($1);
>   SELECT passwd FROM ticket WHERE name = tmp1 AND survey_id = tmp2;
> since the tmp vars will look like params to the optimizer and "var = param"
> is indexable.

Yup, it did work. Thanks!

> Looks like we need to teach the optimizer that expressions involving
> params can be treated like simple params for the purposes of
> optimization.

That'll be good. Anything to speed up the stored procedures are good:
encourage people to put logic processing into the RDBMS where it should
be.