Thread: Forgotten the master password of db

Forgotten the master password of db

From
thiemo
Date:
Hi,

unfortunately I have forgotten the mpassword of the master user of a db.
Is there a way to retrieve it using the user who owns the db template1?

Thx

Thiemo

--
Thiemo Kellner
Tösstalstrasse 146
CH-8400 Winterthur
http://www.toomai.ch.vu
http://www.acok-project.ch.vu


Re: Forgotten the master password of db

From
Tom Lane
Date:
thiemo <thiemo@gmx.ch> writes:
> unfortunately I have forgotten the mpassword of the master user of a db.
> Is there a way to retrieve it using the user who owns the db template1?

No, but you can temporarily set the authorization policy (pg_hba.conf)
to something other than password; log in as the superuser without any
password; assign yourself a new password.

            regards, tom lane

Re: Forgotten the master password of db

From
thiemo
Date:
>> unfortunately I have forgotten the mpassword of the master user of a
>> db.
>> Is there a way to retrieve it using the user who owns the db template1?
>
> No, but you can temporarily set the authorization policy (pg_hba.conf)
> to something other than password; log in as the superuser without any
> password; assign yourself a new password.

I shall try so.

Thanks

Thiemo

--
Thiemo Kellner
Tösstalstrasse 146
CH-8400 Winterthur
http://www.toomai.ch.vu
http://www.acok-project.ch.vu


Re: Forgotten the master password of db

From
Josh Berkus
Date:
thiemo,

> unfortunately I have forgotten the mpassword of the master user of a db.
> Is there a way to retrieve it using the user who owns the db template1?

No, you can't retrieve it.  You can change it, though, as the postgres user:
ALTER USER the_user WITH PASSWORD 'new_password';

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology     josh@agliodbs.com
    and data management solutions     (415) 565-7293
   for law firms, small businesses      fax 621-2533
    and non-profit organizations.     San Francisco


Limiting the result set

From
"Rob"
Date:
Hi guys,

I got a bit of an interesting problem I'm hoping someone can help me solve.

I've got a table that's got over 12000 entries in it     and user's can run
searches on it via the
web.  Now, I only ever want to return a maximum of 500 results (for speed
purposes) for any search.

Now, I've got that right by using the LIMIT command, but I also want to be
able to tell the user
how many records matched their search criteria.  So I want to say something
like

"Your search matched 1234 items.  These are the first 500" or some such
thing.

Is there any way, IN ONE QUERY, to do this.  So I want to basically return
the first 500 results
and a count of the total result set in one go.  Is this possible?

If not, what would be the quickest way to do this?  The reason I need one
query is because I use
dynamic SQL, which complicates stuff a bit more

Thanks

Rob
---

He who dies with the most toys ...

                                   ... still dies



Re: Limiting the result set

From
Bruno Wolff III
Date:
On Fri, Aug 16, 2002 at 10:06:23 +0200,
  Rob <rob@jamwarehouse.com> wrote:
>
> Is there any way, IN ONE QUERY, to do this.  So I want to basically return
> the first 500 results
> and a count of the total result set in one go.  Is this possible?
>
> If not, what would be the quickest way to do this?  The reason I need one
> query is because I use
> dynamic SQL, which complicates stuff a bit more

It is certainly possible to do this, if not efficient.

You can always just union two queries together using an extra column that
is null for the real records and returns the full count in a special
record. Order by can be used to make this record first or last.