[ADMIN] FW: [GENERAL] shell script when a user logs in

2003-01-10 Thread Campano, Troy
Title: Message



I 
posted this in GENERAL, but figured maybe this might be better 
place.
 

-Original Message-From: Campano, Troy 
[mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 
2003 1:56 PMTo: [EMAIL PROTECTED]Subject: 
[GENERAL] shell script when a user logs in
Is there a shell script that executes when a user 
logs into postgresql? 
I wanted to do something like this. I modified the 
pg_ctl shell script so that it emails me when someone users pg_ctl to 
start/stop/etc the postgresql database.
So I was wondering if there was something similar I 
could edit to email me when a user logs in and/or logs out from 
postgresql.
thank you! 
~ Troy Campano ~ 


[ADMIN] Encrypted Passwords

2003-01-10 Thread Rob Abernethy IV
How does postgres calculate the MD5 version of a password to store in the 
database during user creation?  I am trying to set up a postgres JDBCRealm to 
work with Tomcat.  The problem is that the resulting digest from Java is 
different then the digest stored in the database for the same word.

clear-text: tomcat
java: 1b359d8753858b55befa0441067aaed3
postgres: md5efcc1c51a80be13b59cdb96d758a0184

--
Robert Abernethy IV
Dynamic Edge, Inc.
734.975.0460

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [ADMIN] Encrypted Passwords

2003-01-10 Thread Rob Abernethy IV
Perl also came up with the same digest as Java.

--
Robert Abernethy IV
Dynamic Edge, Inc.
734.975.0460

> How does postgres calculate the MD5 version of a password to store 
> in the database during user creation?  I am trying to set up a 
> postgres JDBCRealm to work with Tomcat.  The problem is that the 
> resulting digest from Java is different then the digest stored in 
> the database for the same word.
> 
> clear-text: tomcat
> java: 1b359d8753858b55befa0441067aaed3
> postgres: md5efcc1c51a80be13b59cdb96d758a0184
> 
> --
> Robert Abernethy IV
> Dynamic Edge, Inc.
> 734.975.0460
> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [ADMIN] Encrypted Passwords

2003-01-10 Thread Bruce Momjian
Rob Abernethy IV wrote:
> How does postgres calculate the MD5 version of a password to store in the 
> database during user creation?  I am trying to set up a postgres JDBCRealm to 
> work with Tomcat.  The problem is that the resulting digest from Java is 
> different then the digest stored in the database for the same word.
> 
> clear-text: tomcat
> java: 1b359d8753858b55befa0441067aaed3
> postgres: md5efcc1c51a80be13b59cdb96d758a0184

What did you use as salt?  PostgreSQL users the user name as salt.
When I run /contrib/pgcrypto's MD5 I get the same value as PostgreSQL.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[ADMIN] sequence

2003-01-10 Thread Roberto Benitez
I have a field of serial type.  for some reason, the
sequence skips numbers every now and then. does anyone
know why?

--thanks
--roberto c. benitez

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [ADMIN] repair table? database? how ? neccessary?

2003-01-10 Thread philo vivero
On Mon, 2003-01-06 at 17:21, mitchell laks wrote:
> The main issue I had with Access was that as the database got larger, My 
> application began to fail regularly, and I began to need to do "repair" of 
> the database almost on a daily or other daily basis.
 . . .
> the Postgresql database is currently 5 times the size of the level when I 
> began to have m$ft problems
 . . .
> without problems (knock wood) but what do I do if i need to repair?

Fortunately for you, you're now in a different league of database
backends. PostgreSQL won't need to be 'repaired' unless something
catastrophic happens to it (ie: the HDD becomes corrupted, Linux virtual
memory goes wacko, whatever) -- Each of these problems has an extremely
low likelihood of happening.

However, you are a DBA, and I am a DBA, so we must be paranoid and
assume that tomorrow PostgreSQL will corrupt all our data, Linux will
churn it up with /dev/urandom, and your nice Quantum HDD array will be
subjected to some strong electromagnetic radiation.

Take regular backups of your database (can be done while database is
live), store the backups on media that is physically distant from the
main database.

On a regular basis, restore the backup you've made to another machine
and do at least minimal sanity checking. My own method is to restore a
copy of the production database to the developers' development database
so they can use development versions of production software against the
database.

As for your concerns about killing the postmaster, don't "kill -9" the
postmaster, which is a nasty SIGKILL signal which won't let it clean up.
I believe "kill -15" SIGTERM will make the postmaster shut down as
immediately as is safe. The pg_ctl command is a better way to go about
it, however:

$ pg_ctl --help
 . . .
  pg_ctl stop[-W] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]
 . . .
Shutdown modes are:
  smart Quit after all clients have disconnected
  fast  Quit directly, with proper shutdown
  immediate Quit without complete shutdown; will lead
to recovery run on restart

So in the future, try "pg_ctl stop -m fast" or even "-m immediate" if
necessary. I think, without looking into pg_ctl, that shutdown immediate
is a wrapper for a nice smart "kill -15" -- take this with a grain of
salt.

Enjoy,
--
Tim Ellis
Senior Database Architect



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[ADMIN] auto stop postmaster on cygwin

2003-01-10 Thread somphong s.
i use postgresql 7.3 on cygwin on windows xp home.
i have found somebody suggestion to start pg process as service on XP.
i try and succesful on start as service , and auto start when start
PC.
but i must manually stop the postmaster before i shutdown or restart
PC.
if not the file postmaster.pid will left in /var/pgdata, then auto
start will fail.

1st question is : how to make postmaster process auto stop when
shutdown or restart PC?
2nd question is : if i forget to stop process , will have any problem
or not?

thank you

somphong s.

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[ADMIN] journaling

2003-01-10 Thread Stéphane Akrich



I work with the 
SGBDR OpenIngres2 which has also a WAL mecanism.More over, I journalise my 
database in order to recover the data between thesave of the data and the 
crash.Is it possible to do it with PostgreSQL 
?thanks


[ADMIN] error starting PostgreSQL

2003-01-10 Thread Krzysztof Socki
Hello! I was searching the archives of the site and I've found many posts
concerning problems with starting the postmaster, but noone reported such a
message:
StreamServerPort: bind() failed: Cannot assign requested address
I'm trying to use TCP/IP connection on port 5432. No other proceses use this
port. I've also tried other port - no effect. Can you help?

K. Socki
[EMAIL PROTECTED]



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [ADMIN] restore/dup OIDs HELP!

2003-01-10 Thread Jack Flak
Stephan,

That's very interesting!  I didn't even know about these other "hidden" 
fields.  How many others are there?

You're right about the xmin value.  It's the same for all the dups.  That 
could have saved me a lot of work.  I built a perl script to locate the 
dups, pull the data, re-insert it, and then delete by old OID.

What is the 'ctid' field about?  It's wierd.
For that matter, what is 'xmin'???


Stephan Szabo wrote:

> On Sun, 5 Jan 2003, Jack Flak wrote:
> 
>> Greetings Group,
>>
>> I'm running 7.1.
>>
>> Basically, my question is this:  how do I delete an exact dup without
>> deleting the original?
> 
> You can use one of the other hidden fields.  ctid will be unique for the
> various rows, but I'm not sure of a good way to bulk delete them (tids
> don't seem to have comparison operators so the normal ways I can think of
> don't work).
> 
> If all of the new rows were added by a single transaction (through copy
> say) you'd probably be able to delete all the rows added by that
> transaction using the xmin column.  Find the xmin belonging to those rows
> and delete all the rows having that xmin.
> 
> 
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster
> 


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [ADMIN] restore/dup OIDs HELP!

2003-01-10 Thread Jack Flak
Steve,

Thanks for the excellent suggestion!

Yes, that would have worked.  I guess I did it the hard way.  I wrote a 
nice little perl script to locate the dups by OID and then pull the data, 
re-insert it, and then delete the original dup by OID.  It was smart, I 
could run it as many times as needed and it would not have touched any 
entry which was not dupped.

This is the SQL soltuion to such a problem.  Thanks for the help!


Steve Crawford wrote:

> Would this work for you (if you can muck with the comm table temporarily
> without causing problems)?
> 
> --Create a table with unique values
> create temporary table communique as select distinct * from comm;
> 
> --Empty the table
> delete from comm;
> (or truncate comm if recent enough version or drop and recreate comm if
> it's really large and an older version of PostgreSQL)
> 
> --Repopulate comm from commtemp
> insert into comm select * from commtemp;
> 
> Cheers,
> Steve
> 
> On Saturday 04 January 2003 10:30 pm, Jack Flak wrote:
>> Greetings Group,
>>
>> I'm running 7.1.
>>
>> Basically, my question is this:  how do I delete an exact dup without
>> deleting the original?
>>
>> Let me explain...
>>
>> I just accidentally ran a restore on my perfectly running database. When
>> I originally made the dump file, I had OIDs turned on. I figured they
>> were unique. Now, after the restore is done, I see that they are not.
>>
>> So now I have duplicate entries in a large table. They are duplicate all
>> the way down to the OIDs!  I was stupid enough not to set a unique key
>> field for this table when I designed it, so the system accepted the "new"
>> entries with the exact same OIDs as already existed. However, almost all
>> of my other tables do have unique keys set, so the dups were rejected.
>> Check out my stupidity:
>>
>>
>> # SELECT oid, sender, length(text), date_submitted  FROM comm  ORDER BY
>> sender, date_submitted  LIMIT 20;
>>   oid  | sender | length | date_submitted
>> ---+++
>>  61385 | 132|   2179 | 2001-02-23 16:43:00-08
>>  61385 | 132|   2179 | 2001-02-23 16:43:00-08
>>  61386 | 132|   1313 | 2001-02-25 17:40:00-08
>>  52234 | 154|   2073 | 2001-05-07 23:40:00-07
>>  52234 | 154|   2073 | 2001-05-07 23:40:00-07
>>  49588 | 168|   3063 | 2002-03-20 12:04:00-08
>>  49588 | 168|   3063 | 2002-03-20 12:04:00-08
>>  49592 | 168|   5243 | 2002-03-26 10:54:00-08
>>  49592 | 168|   5243 | 2002-03-26 10:54:00-08
>>  49801 | 188|   1010 | 2000-08-22 12:30:00-07
>>  49801 | 188|   1010 | 2000-08-22 12:30:00-07
>>  49802 | 188|307 | 2000-08-22 12:37:00-07
>>  49802 | 188|307 | 2000-08-22 12:37:00-07
>>  49803 | 188|   1790 | 2000-08-22 12:39:00-07
>>  49803 | 188|   1790 | 2000-08-22 12:39:00-07
>>  49804 | 188|531 | 2000-08-22 12:41:00-07
>>  49804 | 188|531 | 2000-08-22 12:41:00-07
>>  49805 | 188|   4700 | 2000-08-22 12:45:00-07
>>  49805 | 188|   4700 | 2000-08-22 12:45:00-07
>>  49809 | 188|   2855 | 2000-08-22 12:47:00-07
>> (20 rows)
>>
>>
>> The 'sender' field, plus the 'date_submitted' field are used as "the key"
>> for each entry.
>> If you're sharp, you'll notice that for 'sender' 132, there are three
>> total, one dup.  This is because I tried to delete one of the dups.  This
>> was a mistake, as BOTH were deleted.  I re-added it again from the dump
>> file manually (boy, that was really not fun).
>>
>> So, once again, here's my question:  how do I go about deleting the
>> duplicate entries WITHOUT also deleting the originals?
>>
>>
>>
>> ---(end of broadcast)---
>> TIP 3: if posting/reading through Usenet, please send an appropriate
>> subscribe-nomail command to [EMAIL PROTECTED] so that your
>> message can get through to the mailing list cleanly
> 
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster
> 


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [ADMIN] restore/dup OIDs HELP!

2003-01-10 Thread Stephan Szabo

On Thu, 9 Jan 2003, Jack Flak wrote:

> Stephan,
>
> That's very interesting!  I didn't even know about these other "hidden"
> fields.  How many others are there?

Let's see, I think the set is
ctid, oid, xmin, cmin, xmax, cmax, tableoid

IIRC,
 ctid is basically like a physical pointer to where the row actually is
 oid you know
 xmin - transaction that made the row
 cmin - command counter in that transaction that made the row
 xmax, cmax - like xmin, cmin but for the transaction that removes it
 tableoid - which table it belongs to (for inheritance)

Cmin and xmax share storage, and it looks like xmin/xmax are of a type
that you can't actually do much with from an SQL statement.



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[ADMIN] is it postgres issue?

2003-01-10 Thread Rajesh Kumar Mallah.


Hi On updating a table i get following ERROR

tradein_clients=# begin work; UPDATE eyp_listing  set company_id=companies.company_id 
from companies   where eyp_listing.amount > 0  and 
eyp_listing.email=companies.email;
BEGIN
ERROR:  heap_mark4update: (am)invalid tid


is it a postgresql issue?
or is it some contrib module i am using tsearch in this table.


regds
mallah.





-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [ADMIN] is it postgres issue?

2003-01-10 Thread Tom Lane
"Rajesh Kumar Mallah." <[EMAIL PROTECTED]> writes:
> tradein_clients=# begin work; UPDATE eyp_listing  set 
>company_id=companies.company_id from companies   where eyp_listing.amount > 0  and 
> eyp_listing.email=companies.email;
> BEGIN
> ERROR:  heap_mark4update: (am)invalid tid

> is it a postgresql issue?

Possibly, but we'll need to see more detail.

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [ADMIN] error starting PostgreSQL

2003-01-10 Thread Tom Lane
"Krzysztof Socki" <[EMAIL PROTECTED]> writes:
> StreamServerPort: bind() failed: Cannot assign requested address
> I'm trying to use TCP/IP connection on port 5432. No other proceses use this
> port. I've also tried other port - no effect. Can you help?

[ scratches head... ]  Maybe you have virtual_host set to something
invalid?  Or something's bollixed about 127.0.0.1 on your setup?

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]