Обсуждение: MySQL password function
Oh my god. I never thought I'd be asking a MySQL question on this list but being lazy this week I'll give it a shot. I'm attempting to convert an application from MySQL to PostgreSQL. Got pretty much all done except for a few lines loading some sample data into the tables. I didn't even notice this until I got an error message. Just cut and pasted the code into psql. The insert statement has one value of "password('foo')." Since the app was designed for MySQL I'm sure I'll run into this later so I need to figure out the PgSQL way or a workaround. My guess is this is a function to encrypt 'foo'. Is there a similar functionality in Pg? My look through Bruce's and the O'Reilly Mammoth books turned up nothing. Is there something in contrib that does this? TIA, Rod -- "Open Source Software - Sometimes you get more than you paid for..."
I'm not sure what mysql uses for passwords, but the source is available so you could always wrip out the code for their password function and make a postgresql version... then you wouldn't have to change any of the SQL scripts at all... -philip On Wed, 10 Jul 2002, Roderick A. Anderson wrote: > Oh my god. I never thought I'd be asking a MySQL question on this list > but being lazy this week I'll give it a shot. > > I'm attempting to convert an application from MySQL to PostgreSQL. Got > pretty much all done except for a few lines loading some sample data into > the tables. I didn't even notice this until I got an error message. Just > cut and pasted the code into psql. > > The insert statement has one value of "password('foo')." Since the app > was designed for MySQL I'm sure I'll run into this later so I need to > figure out the PgSQL way or a workaround. My guess is this is a function > to encrypt 'foo'. Is there a similar functionality in Pg? My look > through Bruce's and the O'Reilly Mammoth books turned up nothing. Is > there something in contrib that does this? > > > TIA, > Rod > -- > "Open Source Software - Sometimes you get more than you paid for..." > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >
On Wed, Jul 10, 2002 at 12:58:09PM -0700, Roderick A. Anderson wrote: > The insert statement has one value of "password('foo')." Since the app > was designed for MySQL I'm sure I'll run into this later so I need to > figure out the PgSQL way or a workaround. I believe contrib/pgcrypto will do this for you (and give you a bunch of digest algorithms to choose from). Cheers, Neil -- Neil Conway <neilconway@rogers.com> PGP Key ID: DB3C29FC
On Wed, 10 Jul 2002, Neil Conway wrote: > On Wed, Jul 10, 2002 at 12:58:09PM -0700, Roderick A. Anderson wrote: > > The insert statement has one value of "password('foo')." Since the app > > was designed for MySQL I'm sure I'll run into this later so I need to > > figure out the PgSQL way or a workaround. > > I believe contrib/pgcrypto will do this for you (and give you a bunch > of digest algorithms to choose from). Neil, Philip, Thanks for the ideas. When I read Phillip's I thought "Oh Great" 'cause I stay as far away from MySQL as I can. Then I read Neil's reply and slapped my forehead and said doh! Again thanks, Rod -- "Open Source Software - Sometimes you get more than you paid for..."