Re: [GENERAL] Multiple postgresql installations on one machine.

2001-10-13 Thread Tom Lane

Charles Tassell [EMAIL PROTECTED] writes:
 I may be wrong, but I don't think it's possible to have them on the same 
 port.  The problem is that the TCP/IP port defaults to the same as the UNIX 
 sockets port, and UNIX sockets are local to the machine, so they are 
 completely independent of IP addresses and can not be duplicated.

Unix sockets need to have unique pathnames in the local filesystem.
The PG port number is actually only a component of the file name.
So all you need to do if you need to have conflicting port numbers
is to vary the unix_socket_directory parameter for each postmaster.

However, varying the port number is probably a simpler attack...

 I can't seem to tell psql where to find the moved unix socket.

Use -h /path/to/directory/containing/socket.  AFAIR you can set the
path in PGHOST environment variable, if that helps.

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: [GENERAL] A tool for making console/text data enrty/display screens in C

2001-10-13 Thread Andrej Falout

In article 3bc3915b.1185965@gtech, degoble@gtech says...
 
 I am lazy. I which to write some c console/text programs to interface
 with postgresql. Are there any tools/utilities, to help make the data
 entry/display screens...?

Aubit is much more then you asked for, but it will allow you to do this 
really easy, and result is C code. See my sig.


-- 
Yours, Andrej Falout, http://www.falout.com/disclaimer.html
Visit the OpenSource alternative, Aubit 4gl: 
http://aubit4gl.sourceforge.net
PLEASE NOTE: All HTML email sent to me WILL BE DELETED AUTOMATICALLY 
WITHOUT READING.

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



Re: [GENERAL] Rotating PostgreSQL LOGs on Web site ??

2001-10-13 Thread Bruce Momjian


I think the general solution is to compile with syslog support and use
the normal syslog rotation scripts.

 Hi,
 
 I'm interesting to know how to find a solution for rotating the
 PostgreSQL log file ...
 
 I'm usgin thoses options for the log generated :
 silent_mode = false
 log_connections = false
 log_timestamp = true
 log_pid = false
 debug_level = 2 # range 0-16
 debug_print_query = false
 debug_print_parse = false
 debug_print_rewritten = false
 debug_print_plan = false
 debug_pretty_print = false
 
 BUT I have in 13 days a log file of 12 Gb ...
 
 The big trouble is ... that is a web site Database ...
 So It's IMPOSSIBLE for me to STOP the database ... or finding a solution
 to not loose my members subscribing ...
 
 And if I stop PostgreSQL ... I'll have also to restart the Apache
 servers wich are connected to the database ... and that's mean really
 good cron timing ...
 
 So if you have any ideas about that ... I'll be so pleased for your help
 !!
 
 Regards,
 -- 
 Herv?
 
 ---(end of broadcast)---
 TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



[GENERAL] Book webpage update

2001-10-13 Thread Bruce Momjian

I have updated my book's web page at:

http://www.postgresql.org/docs/awbook.html

Additions include:

o Information about the new German and Japanese translations
o Book reviews
o Two new chapters, in HTML and PDF format

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [GENERAL] Contents of greatbridge.com?

2001-10-13 Thread Tom Lane

 No one has mentioned it so far, but I wonder if any of the Great
 Bridge people were hired by Red Hat?

The reason it hasn't been mentioned is that negotiations are still
in play.  I believe I can safely say that RH hasn't hired any ex-GB
people yet ... but I doubt that will hold true for long ...

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: [GENERAL] COMMIT after an ERROR?

2001-10-13 Thread J C Lawrence

On Fri, 12 Oct 2001 19:35:30 -0700 
patrick keshishian [EMAIL PROTECTED] wrote:

 The only things that are not rolled back are advancing of
 sequences and such.  I suspect serial types also exhibit similar
 behavior to sequences.

Ahh, that's actually critical information (which makes sense too
BTW).  thinks  Excellent.  Then as long as the auto-ROLLBACK on
error is a guaranteed ANSI behaviour rather than a PGSQL thing,
everything is just perfect.  Thanks.

-- 
J C Lawrence
-(*)Satan, oscillate my metallic sonatas.
[EMAIL PROTECTED]   He lived as a devil, eh?
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.

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

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



Re: [GENERAL] Any Good Way To Do Sync DB's?

2001-10-13 Thread Tom Lane

Gordan Bobic [EMAIL PROTECTED] writes:
 I'm going to have to rant now. The dump and restore which use the COPY
 method are actually totally useless for large databases. The reason for
 this is simple. Copying a 4 GB table with 40M rows requires over 40GB of
 temporary scratch space to copy, due to the WAL temp files. That sounds
 totally silly. Why doesn't pg_dump insert commits every 1000 rows or so???

Yup, rant is the correct term.  The WAL file growth problem has been
fixed as of 7.1.3, so your premise is false.

regards, tom lane

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

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



Re: [GENERAL] [Off-topic, Meta-question] Problems with psql-general list

2001-10-13 Thread Tom Lane

Allan Engelhardt [EMAIL PROTECTED] writes:
 1. Am I the only one who are having problems with the listerver not honouring the 
NOMAIL option?

Marc said yesterday that he'd been forced to rebuild the subscriber list
for pgsql-general.  Sounds like your NOMAIL preference got lost in the
shuffle :-(.  You should be able to reconfigure it the way you want by
issuing the appropriate command to majordomo.

 2. The list (comp.databases.posrgresql.general) seems to have been
 removed from several downstream NNTP servers.  Anybody know why, and,
 again, am I the only one with this problem?

AFAIK the comp.databases.postgresql newsgroups are not recognized Usenet
groups, because no one ever bothered with going through the standard
voting procedure for them.  Accordingly, they won't be present on
servers that are maintained by-the-book.  You'll need to find a server
whose newsadmin has specifically chosen to carry them.

regards, tom lane

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



[GENERAL] why do I receive these news-group posts in my mail box?

2001-10-13 Thread David Pirotte

i was suppose to read the news group, not to receive messages
in my mail box, which is what happens since few days

can anyone in charge see what happens: it's only sort of 2 days
ago that this started, before everything was OK

thanks,
david

---(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



[GENERAL] PGSQL java applets

2001-10-13 Thread Svenne Krap

Hi, 

Is it possible to use pgsql in java-applets.

If it is, any skeleton app woudl be greatly appriciated... 

/Svenne
-- 
Mail [EMAIL PROTECTED] - [EMAIL PROTECTED] - PGP key id : 0xDF484022
ICQ: 5434480 - http://www.krap.dk - http://www.krap.net 
PGP Key http://keys.pgp.dk:11371/pks/lookup?op=getsearch=0xDF484022

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Re: [GENERAL] [Off-topic, Meta-question] Problems with psql-general list

2001-10-13 Thread Allan Engelhardt

Tom Lane wrote:

 Allan Engelhardt [EMAIL PROTECTED] writes:
  1. Am I the only one who are having problems with the listerver not honouring the 
NOMAIL option?

 Marc said yesterday that he'd been forced to rebuild the subscriber list
 for pgsql-general.  Sounds like your NOMAIL preference got lost in the
 shuffle :-(.  You should be able to reconfigure it the way you want by
 issuing the appropriate command to majordomo.

I've tried that three times over the last week.  I tried again on Friday.  I'll try 
again now, but there is a problem somewhere.  I'd really rather not have to 
unsubscribe..

Thanks for the answers.

Allan.


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Re: [GENERAL] Multiple postgresql installations on one machine.

2001-10-13 Thread Lincoln Yeoh

Thanks. I didn't know psql -h did that, thought it was for hostnames only :).

So I resorted to TCP access for the rest of the installations and moved the
sockets out of the way. However the Redhat style initscript tends to
shutdown all installations - even though I specified a different PID file
:(. I guess I might need to fix that one - coz the idea is to have them
independent.

Was actually wondering if I could change the name of the socket to
something like ...portnumber.virtual_host_name_or_ip_address

That way psql -h vhost1 would try usualprefix.defaultport.vhost1

psql by itself would try usualprefix.defaultport

(have to convert dots and slashes in addresses to underscores or something
more innocuous, or quote carefully)

Probably not that useful now that I know more about -h :).

Cheerio,
Link.
 
At 12:03 AM 10/13/01 -0400, Tom Lane wrote:
Charles Tassell [EMAIL PROTECTED] writes:
 I may be wrong, but I don't think it's possible to have them on the same 
 port.  The problem is that the TCP/IP port defaults to the same as the
UNIX 
 sockets port, and UNIX sockets are local to the machine, so they are 
 completely independent of IP addresses and can not be duplicated.

Unix sockets need to have unique pathnames in the local filesystem.
The PG port number is actually only a component of the file name.
So all you need to do if you need to have conflicting port numbers
is to vary the unix_socket_directory parameter for each postmaster.

However, varying the port number is probably a simpler attack...

 I can't seem to tell psql where to find the moved unix socket.

Use -h /path/to/directory/containing/socket.  AFAIR you can set the
path in PGHOST environment variable, if that helps.

   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




---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Re: [GENERAL] Any Good Way To Do Sync DB's?

2001-10-13 Thread Gurunandan R. Bhat

On 12 Oct 2001, Doug McNaught wrote:

 Probably the best thing to do is to export the data from Progress in a 
 format that the PostgreSQL COPY command can read.  See the docs for
 details. 

Hi,

I wrote a quick and dirty function/trigger to sync two DBs - one 
local and the other on the web. The method is quite simple. Any insert or 
update fires a trigger that serialises the entries and stores it in a 
log with the table name, the primary key and the timestamp. When an entry 
is deleted, the same happens except that the serialised column contains a 
null. So when I sync, I just need to upload the changes and not the entire 
dump. I think this is a good opportunity to get some advice feedback on 
the code, so here it is:


drop function setuptriggers();
create function setuptriggers() returns int as '
   declare
fb  text;
tb  text;
tresult record;
cresult record;
pkeynamename;
begin
for tresult in select * from pg_class
  where relkind = ''r''
  and   relname !~ ''^pg_''
  and   relname !~ ''^Inv''
  and   relname !~ ''^pga_''
  order by relname
loop
select into pkeyname c.attname from pg_class a, pg_index b, 
pg_attribute c 
where a.relname = tresult.relname and 
  a.oid = b.indrelid and 
  a.oid = c.attrelid and 
  b.indkey[0] = c.attnum and 
  b.indisprimary=''t'';
if pkeyname is not null and tresult.relname != ''logtable'' 
then
   fb := ''
  create function logchange_'' || 
quote_ident(tresult.relname) || ''() returns opaque as 
  declare
 serialized text;
 updatetime timestamp;
 separator text;
  begin
 updatetime := now;
 separator := chr(178);
 serialized := ;
  '';
  for cresult in select * from pg_class a, pg_attribute b
   where a.relname = tresult.relname and
   a.oid = b.attrelid and
   b.attnum  0
   order by b.attnum
  loop
fb := fb || ''   if NEW.'' || 
quote_ident(cresult.attname) || '' is not null then
  serialized := serialized || separator || 
'' || quote_ident(cresult.attname) || ''= ||  NEW.'' || 
quote_ident(cresult.attname) || '';
 end if;
  '';
  end loop;
  fb := fb || ''   insert into logtable values (NEW.''|| 
quote_ident(pkeyname) || '', '' || quote_ident(tresult.relname) || '', 
serialized, updatetime);
 return new;
  end;
  language plpgsql;'';
  execute fb;
  tb := ''create trigger fireon_'' || 
quote_ident(tresult.relname) || '' before insert or update on '' || 
quote_ident(tresult.relname) || ''
for each row execute procedure logchange_'' || 
quote_ident(tresult.relname) || ''();'';
  execute tb;
end if;
end loop;
return 1;
end;'
language 'plpgsql';
-
I hope this is usefule


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

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