[HACKERS] client encodings

2003-06-15 Thread Dennis Björklund
I've fixed the problems in psql that was there before:

 * psql alters the strings in a PQresult
 * psql sends non validating strings to server

This is however not the solution to the general problem with client 
encodings. When you normally run psql in a terminal, the encoding used by 
that terminal is the only reasonable encoding one can use. However, if you 
redirect the output you very well might want to produce a utf-8 file even 
if the terminal does not suppert it. So it could be usable to change the 
client encoding in psql.

However, if you want to produce a utf-8 file, how should that work with 
respect to gettext()? If the message catalog is in latin1 then we need to 
know that and convert that into utf-8.

The easiest way as I see it is to demand that all po files are stored in
utf-8 and then you can convert that into whatever client encoding you have
set in psql. Of course you can't make that translation lossfree in
general, but if you have a language that demands some characters that
don't exist in the target charset you have lost anyway. The best you can
do is to convert it to something similar (or even just through it away).

To store all po files as utf-8 is not a big problem. The translator can
very well still work using some other charset and then you use iconv to
convert it before checking it in. As long as you don't change that file
(and use other characters) the translator can later on use iconv again to
get it back to his charset. The good thing about this is that psql knows
what charset all strings are in and can convert when needed.

Would it be acceptable to have all po-files as utf-8?

-- 
/Dennis


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

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] Pre-allocation of shared memory ...

2003-06-15 Thread Shridhar Daithankar
On 14 Jun 2003 at 16:38, Andrew Dunstan wrote:
 Summary: don't take shortcuts looking for this - Read the Source, Luke. It's
 important not to give people false expectations. For now, I'm leaning in
 Tom's direction of advising people to avoid Linux for mission-critical
 situations that could run into an OOM.

While I agree that vanilla linux does not handle the situation gracefully 
enough, anybody running a mission critical application should spec. the machine 
and the demads on the same carefully enough. For certain linux won't start 
doing OOM kill because it started going low on buffer memory. ( At least I hope 
so.)

If on expects to throw uncalculated amount of load on a mission critical box, 
till it reaches swap for every malloc in a strcpy, there are things need to be 
checked before which kernel/OS you are running.

And BTW whas that original comment for vanilla liux or linux in general..:-)


Bye
 Shridhar

--
Adore, v.:  To venerate expectantly.-- Ambrose Bierce, The 
Devil's 
Dictionary


---(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: [HACKERS] Pre-allocation of shared memory ...

2003-06-15 Thread Andrew Dunstan
Alan Cox has written to me thus:

 It got dropped for RH9 and some errata kernels because of clashes between
 the old stuff and the rmap vm and other weird RH patches

andrew

- Original Message - 
From: Andrew Dunstan [EMAIL PROTECTED]
To: Tom Lane [EMAIL PROTECTED]
Cc: Kurt Roeckx [EMAIL PROTECTED]; Matthew Kirkwood
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, June 14, 2003 5:39 PM
Subject: Re: [HACKERS] Pre-allocation of shared memory ...


 I know he does -  *but* I think it has probably been wiped out by accident
 somewhere along the line (like when they went to 2.4.20?)

 Here's what's in RH sources - tell me after you look that I am looking in
 the wrong place. (Or did RH get cute and decide to do this only for the AS
 product?)



---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[HACKERS] Data recovery - URGENT

2003-06-15 Thread Peter Galantha
Hello,

is there a way to recover data from a damaged database if 
a.) we have some but not all datafiles
b.) we have all datafiles but system tables are currupted

The situation is extremely critical so we're interested in all possible 
solutions even if it's time consuming or if we need to pay for it!

Version: Postgres v7.1
OS: Debian Linux 3.0
Storage: RAID 5 and RAID 1 (the array is dead and we might not be able to 
restore all data, but there are good chances to recover about 90% of the 
data)

Thanks  regards,
Peter Galantha
[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


[HACKERS] sa_family_t in cygwin compile of cvs + regression failure

2003-06-15 Thread deststar
On cygwin sa_family_t was undeclared, adding the following line:
typedef unsigned short sa_family_t;
to both:
src/port/getaddrinfo.c
src/include/libpq/pqcomm.h
seemed to compile ok but with make check there was one regression 
failure in test privileges (doesn't look realted, but I'm not sure).
Also included for ease of testing is a patch sepratly sent to patches 
for ecpg.
System: Athalon + Win 2k + cygwin 1.3.22 + gcc 3.2
*** ./expected/privileges.out   Wed May 14 04:26:04 2003
--- ./results/privileges.outSun Jun 15 16:12:34 2003
***
*** 10,18 
--- 10,22 
  CREATE GROUP regressgroup1;
  CREATE GROUP regressgroup2 WITH USER regressuser1, regressuser2;
  ALTER GROUP regressgroup1 ADD USER regressuser4;
+ WARNING:  AbortTransaction and not in in-progress state
+ ERROR:  rename 
/home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group.2284 
to /home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group: 
Permission denied
  ALTER GROUP regressgroup2 ADD USER regressuser2;  -- duplicate
  WARNING:  ALTER GROUP: user regressuser2 is already in group regressgroup2
  ALTER GROUP regressgroup2 DROP USER regressuser2;
+ WARNING:  AbortTransaction and not in in-progress state
+ ERROR:  rename 
/home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group.2284 
to /home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group: 
Permission denied
  ALTER GROUP regressgroup2 ADD USER regressuser4;
  -- test owner privileges
  SET SESSION AUTHORIZATION regressuser1;

==

*** src/interfaces/ecpg/compatlib/Makefile.orig Thu May 22 18:20:44 2003
--- src/interfaces/ecpg/compatlib/Makefile  Sun Jun 15 15:45:34 2003
***
*** 17,23 
  SO_MINOR_VERSION= 0.0
  
  override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include 
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
! SHLIB_LINK = -L../pgtypeslib -lpgtypes
  
  OBJS= informix.o
  
--- 17,23 
  SO_MINOR_VERSION= 0.0
  
  override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include 
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
! SHLIB_LINK = -L../pgtypeslib -lpgtypes -L../ecpglib -lecpg
  
  OBJS= informix.o
  

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


[HACKERS] exit status 512

2003-06-15 Thread Peter Galantha
Hi hackers,

there was a hardware failure 'couse we had to turn off the computer manually.
After the hardware change, the database reports exit status 512.

Can anybody help me what 'Startup proc 850 exited with status 512' mean?
how can I solve this problem?

Peter Galantha
argosz at tensa.net


---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] exit status 512

2003-06-15 Thread Tom Lane
Peter Galantha [EMAIL PROTECTED] writes:
 Hi hackers,
 there was a hardware failure 'couse we had to turn off the computer manually.
 After the hardware change, the database reports exit status 512.

 Can anybody help me what 'Startup proc 850 exited with status 512' mean?

You're showing us the wrong error message, ie, the postmaster's
complaint that the startup process failed, not the startup process's
report about why.  What does it say before that?

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Markus Bertheau
 , 13.06.2003,  20:02, Oleg Bartunov :
 Hi there,
 
 I've  managed to get postgresql working with UTF8 and KOI8.
 Here is some mini-howto:
 http://www.sai.msu.su/~megera/postgres/utf8.html

The correct name for UTF-8 locales is xx_XX.UTF-8, not upper case and
the minus.

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.

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

   http://archives.postgresql.org


Re: [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Markus Bertheau
 , 15.06.2003,  21:08, Markus Bertheau :

 The correct name for UTF-8 locales is xx_XX.UTF-8, not upper case and
   s/not/note/
 the minus.
-- 
Markus Bertheau.
Berlin, Berlin.
Germany.

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

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Markus Bertheau
 , 13.06.2003,  20:02, Oleg Bartunov :
 Hi there,
 
 I've  managed to get postgresql working with UTF8 and KOI8.
 Here is some mini-howto:
 http://www.sai.msu.su/~megera/postgres/utf8.html

select lower(''); returns '' with this setup here, any
idea why this is the case?

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.

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

   http://archives.postgresql.org


Re: [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Oleg Bartunov
Markus,

I have used ru_RU.utf8 which recognized by system,  at least that name
was generated by localedef program.

Oleg
On Sun, 15 Jun 2003, Markus Bertheau wrote:

  , 15.06.2003,  21:08, Markus Bertheau :

  The correct name for UTF-8 locales is xx_XX.UTF-8, not upper case and
s/not/note/
  the minus.


Regards,
Oleg
_
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---(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] [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Oleg Bartunov
On Sun, 15 Jun 2003, Markus Bertheau wrote:

  , 13.06.2003,  20:02, Oleg Bartunov :
  Hi there,
 
  I've  managed to get postgresql working with UTF8 and KOI8.
  Here is some mini-howto:
  http://www.sai.msu.su/~megera/postgres/utf8.html

 select lower(''); returns '' with this setup here, any
 idea why this is the case?

No idea :-) I just tested sorting and didn't even tried upper,lower.
I suspect the problem is real. At least, perl (5.6.1) handles uc,lc function
using special pragma 'use utf8'.

Let me know if you get any success.

Oleg




Regards,
Oleg
_
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---(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] [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Oleg Bartunov
Marcus,

I suspect lower,upper will not works with Unicode.
Read thread http://fts.postgresql.org/db/msg.html?mid=1070198
Tatsuo is the right person to ask.


Oleg
On Mon, 16 Jun 2003, Oleg Bartunov wrote:

 On Sun, 15 Jun 2003, Markus Bertheau wrote:

   , 13.06.2003,  20:02, Oleg Bartunov :
   Hi there,
  
   I've  managed to get postgresql working with UTF8 and KOI8.
   Here is some mini-howto:
   http://www.sai.msu.su/~megera/postgres/utf8.html
 
  select lower(''); returns '' with this setup here, any
  idea why this is the case?

 No idea :-) I just tested sorting and didn't even tried upper,lower.
 I suspect the problem is real. At least, perl (5.6.1) handles uc,lc function
 using special pragma 'use utf8'.

 Let me know if you get any success.

   Oleg

 
 

   Regards,
   Oleg
 _
 Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
 Sternberg Astronomical Institute, Moscow University (Russia)
 Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
 phone: +007(095)939-16-83, +007(095)939-23-83

 ---(end of broadcast)---
 TIP 9: the planner will ignore your desire to choose an index scan if your
   joining column's datatypes do not match


Regards,
Oleg
_
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---(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] [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Markus Bertheau
 , 16.06.2003,  01:26, Oleg Bartunov :
 Markus,
 
 I suspect lower,upper will not works with Unicode.

It doesn't work with KOI8-R here, too.

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.

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


Re: [HACKERS] Data recovery - URGENT

2003-06-15 Thread Jan Wieck
Peter Galantha wrote:
Hello,

is there a way to recover data from a damaged database if 
a.) we have some but not all datafiles
b.) we have all datafiles but system tables are currupted

The situation is extremely critical so we're interested in all possible 
solutions even if it's time consuming or if we need to pay for it!
Okay, data in lost datafiles will be lost (surprise, surprise).

But for the other parts ...

Corrupt or missing index files are no big deal (as long as they are user 
indexes.

Corrupt system index files ... hmmm ... don't remember if v7.1 did a 
good job on system index recovery. Worst case we might have to consider 
that a corrupt catalog.

If system tables are corrupted, the complete schema of the database must 
be known otherwise. If not, this will become some detective work to 
figure out the table structures. Maybe another, older backup exists and 
the schema didn't change after that.

The real key is the commitlog. If that is available, the data files that 
can be recovered could be injected into some sort of emergency room 
database system at least.

I am already constructing a v7.1 testbed, and will be able to answer 
more detailed questions in a few minutes. For speed you can reach me on 
+1 978-697-7733.

Jan

Version: Postgres v7.1
OS: Debian Linux 3.0
Storage: RAID 5 and RAID 1 (the array is dead and we might not be able to 
restore all data, but there are good chances to recover about 90% of the 
data)

Thanks  regards,
Peter Galantha
[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


--
#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] security flaw

2003-06-15 Thread Christopher Kings-Lynne
 Since schemas provide a simple way to limit your own view, they provide
 for that function.

 Can phppgadmin be programmed to only use certain search paths in the
 schema?

Not at the moment. The only control you have is 'show only owned databases'.
'Show only owned schemas' is also quite easy.  Even better would be if I
filtered the list of schemas by 'has_object_privilege(schemaoid, 'USAGE')'
or however that function works.

The general philosophy of phpPgAdmin is to allow everything that PostgreSQL
allows and don't try to be clever about restricting things because such
restrictions are pure fantasy since we let people execute whatever SQL they
want.

Chris


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

   http://archives.postgresql.org


Re: [HACKERS] Groups and roles

2003-06-15 Thread Christopher Kings-Lynne
  1. Do we want to someday allow groups to have groups as members?  (Seems
  reasonable to me.)

 I agree.

I think the other requirement of roles is that they are able to own objects.
ie. we need to allow groups to own objects.

Chris


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

   http://archives.postgresql.org


Re: [HACKERS] Groups and roles

2003-06-15 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes:
 I think the other requirement of roles is that they are able to own objects.
 ie. we need to allow groups to own objects.

Hm.  That seems to be another reason to unify usesysid and grosysid into
a single unique something-id.  Which probably implies unifying pg_shadow
and pg_group into one table.

regards, tom lane

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


Re: [HACKERS] enumeration type?

2003-06-15 Thread Christopher Kings-Lynne
There is no such thing as an enumeration type.  What there is is the char
type with a CHECK constraint. MySQL made up ENUMs out of whole cloth...they
should copy our way, not us theirs...

Chris

- Original Message - 
From: Andrew Dunstan [EMAIL PROTECTED]
To: PostgreSQL Hackers Mailing List [EMAIL PROTECTED]
Sent: Sunday, June 15, 2003 4:49 AM
Subject: [HACKERS] enumeration type?


 This occurred to me yesterday as I was designing a little Db.

 Has anyone thought about support for a simple enumeration type creation
 mechanism? I know I could do it with CREATE TYPE and input/output
functions,
 but that does seem like a lot of work for a smallish thing.

 As it is, I settled on a char type with some constraint checking, but
 couldn't help thinking how nice a simple enumeration would have been.

 andrew


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



---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] Groups and roles

2003-06-15 Thread Christopher Kings-Lynne
 Christopher Kings-Lynne [EMAIL PROTECTED] writes:
  I think the other requirement of roles is that they are able to own
objects.
  ie. we need to allow groups to own objects.

 Hm.  That seems to be another reason to unify usesysid and grosysid into
 a single unique something-id.  Which probably implies unifying pg_shadow
 and pg_group into one table.

Bear in mind that I recalled that from something I thought you (or someone)
said on the list earlier and I thought you had forgotten about...

eg. I don't know that that's a requirement...

Chris


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


Re: [GENERAL] [HACKERS] UTF8 and KOI8 mini-howto

2003-06-15 Thread Oleg Bartunov
On Mon, 16 Jun 2003, Markus Bertheau wrote:

  , 16.06.2003,  01:26, Oleg Bartunov :
  Markus,
 
  I suspect lower,upper will not works with Unicode.

 It doesn't work with KOI8-R here, too.


What ? It works for me for years ! Did you check your system locale ?



Regards,
Oleg
_
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

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

   http://www.postgresql.org/docs/faqs/FAQ.html