[HACKERS] Re: [GENERAL] Trouble porting postgreSQL to WinNT

2001-01-30 Thread Peter T Mount

Quoting Tom Lane [EMAIL PROTECTED]:

 This doesn't make any sense, since genbki.sh has nothing to do with
 creating the fmgr.h file.  I think your rebuild probably cleaned up
 something else ... hard to tell what though.

On a similar vein, is anyone seeing initdb hanging under NT? So far everything 
compiles, but it just hangs (CPU isn't going anything either, so it's not 
looping etc).

Peter

-- 
Peter Mount [EMAIL PROTECTED]
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



Re: [HACKERS] BLOB HOWTO??

2001-01-30 Thread Franck Martin

I'm interested by TOAST, and I have asked several questions on the subject...
I haven't tested them yet...

First I thought that the type bytea allows storing of binary data, a BSOB
(Binary Small OBject).
Secondly that by using a binary cursor you have access to the raw data as it
is stored in the database, but not as it is presented in ASCII
Thridly we could use a funtion to retreive parts of columns, something like
mid(column,start,length)
Fourthly we may use the same function for storing data back.

Cheers...
[EMAIL PROTECTED]

Jan Wieck wrote:

 Olivier PRENANT wrote:
  Hi Bruce,
 
  Any idea when it's due for??
  I've been thining about writing a user function; But I'll get stuck with
  permission as a user function is running under the "postgres" or whatever
  user instead of the calling user.
 
  Also, what kind of binary interface are you thinking of??

 Something similar to the existing lo_...() functions.

 Actually,  someone  should  use the existing large objects to
 deal with binary content.  What has to be kept in mind is

 1.  You have to cleanup yourself - the existing large objects
 aren't  removed  automatically  if you delete a table row
 referencing to the LO or drop the table.

 2.  The existing LOs don't have copy  behaviour.  So  if  you
 reference  to  a  LO  from one table and do an INSERT ...
 SELECT, just it's OID is copied,  not  the  data  (as  it
 should be IMHO).

 Jan

 --

 #==#
 # It's easier to get forgiveness for being wrong than for being right. #
 # Let's break this rule - forgive me.  #
 #== [EMAIL PROTECTED] #

 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com




Re: [HACKERS] Like vs '='

2001-01-30 Thread m w

In 7.1 the row limit is not as big a deal because of
tuple toaster. I had a 7.0 database that needed the
row limit change, in 7.1 it does not seem too.

But if you want to chang it anyway, in config.h, look
for this line:

#define BLCKSZ  8192

It can be made as large as 32768.


--- Manuel Cabido [EMAIL PROTECTED] wrote:
 Hi there,
 
I am compiling postgresql 7.1beta4. How would i
 change the default 8k
 row limit? 
 
 -- 
   Manny C. Cabido
  
 
  
 e-mail:[EMAIL PROTECTED]
 
 [EMAIL PROTECTED]
  
 =
 


__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



[HACKERS] I'm off

2001-01-30 Thread Jan Wieck

Hi,

headed  for  LinuxWorld  now.  Will  be  back on the lists on
Monday 5th.  Take care.


Jan

--

#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Re: [HACKERS] Size of TODO.detail

2001-01-30 Thread Bruce Momjian

 Bruce Momjian wrote:
  
  pgsql/docs/TODO.detail now is 1.1MB.  I just removed 'subquery' which
  shrunk it from 1.5MB.  Comments?
 
 Yow!  Nice stuff in there, that is for sure.  Of course, that's alot of
 space.  What to do? Remove all the unnecessary e-mail headers? 
 Signatures?  etc?  excessive quotes? Isn't there a e-mail header
 stripping utility around that can un-header things, leaving some but not
 all?

I just tried 'printmail' that strips off most of the unused stuff:


From: Bruce Momjian [EMAIL PROTECTED]
Subject: [HACKERS] Fix for RENAME
To: PostgreSQL-development [EMAIL PROTECTED]
Date: Sun, 12 Mar 2000 22:59:56 -0500 (EST)

---

#$ printmail tablespaces /bjm/x
#$ l /bjm/x
-rw-r--r--  1 root  wheel  328855 Jan 30 12:16 /bjm/x
#$ l tablespaces 
-rw-r--r--  1 postgres  wheel  495730 Jan 19 00:09 tablespaces

---

Doesn't seem like it saves enough, and it will prevent people from
reading the mailbox in their mail readers.

Compress takes it to 100k, which is much smaller.  Of course, the tar
file has it compress too, so pre-compressing it doesn't buy us anything.

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



Re: [HACKERS] Re: [GENERAL] Trouble porting postgreSQL to WinNT

2001-01-30 Thread Barry Lind

Peter,

Yes I had the same problem, but for me the reason was that I forgot to
start the ipc-daemon before running initdb.  Last night I had no
problems installing beta4 on WinNT 4.0.

thanks,
--Barry

Peter T Mount wrote:
 
 Quoting Tom Lane [EMAIL PROTECTED]:
 
  This doesn't make any sense, since genbki.sh has nothing to do with
  creating the fmgr.h file.  I think your rebuild probably cleaned up
  something else ... hard to tell what though.
 
 On a similar vein, is anyone seeing initdb hanging under NT? So far everything
 compiles, but it just hangs (CPU isn't going anything either, so it's not
 looping etc).
 
 Peter
 
 --
 Peter Mount [EMAIL PROTECTED]
 PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
 RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



[SQL] Re: [HACKERS] 7.1beta4 bug creating a certain table

2001-01-30 Thread Kovacs Zoltan

On Mon, 29 Jan 2001, Tom Lane wrote:

 Kovacs Zoltan [EMAIL PROTECTED] writes:
  CREATE TABLE pakolas_cikktetel (
  pakolas int4 not null,
  cikk int4 not null,
  minoseg int4 not null,
  sorszam int4 check (sorszam  0),
  helyrol int4,
  helyre int4,
  mennyi numeric(14,4) not null ,
  lezarva bool default 'f',
  primary key (pakolas, cikk, minoseg, sorszam),
  unique (pakolas, cikk, minoseg, helyrol, helyre));
 
  CREATE TABLE keszlet_bevetel (
  keszletnovekedes int4 not null primary key,
  pakolas int4 not null,
  cikk int4 not null,
  minoseg int4 NOT NULL,
  foreign key (pakolas, cikk, minoseg)
  references pakolas_cikktetel(pakolas, cikk, minoseg));
 
  ERROR:  UNIQUE constraint matching given keys for referenced table 
  "pakolas_cikktetel" not found
 
 It appears to me that this is correct, since there is no constraint
 on the first column that says that those three columns form a unique
 key *by themselves*.  I believe there were bugs in the code that checked
 for this error before ...
 
   regards, tom lane
 
I don't know the exact SQL definition whether my declaration is correct or
not. But, checking our model, we realized that our implementation is not
correct. So I should rewrite these definitions. Thanks! :-)

But, if this declaration is not correct in the sense of SQL standards, I
can imagine that PostgreSQL may allow such declarations. (A NOTICE may be
given instead of an ERROR.) Or, are there any drawbacks of allowing this?

Zoltan
-- 
 Kov\'acs, Zolt\'an
 [EMAIL PROTECTED]
 http://www.math.u-szeged.hu/~kovzol
 ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz




[HACKERS] Like vs '=' bug with indexing

2001-01-30 Thread m w

I am reposting this because I'm not sure it actually
made it to the list.


I have a function to transform text into a
pseudo-metaphone variable, take this example:

cddbsql=# select song, metatext(song) from cdsongs
where metatext(song) like metatext('born to run')
limit 3 ;
song | metatext
-+--
 Born To Run | brntorn
 Born To Run | brntorn
 Born To Run | brntorn
(3 rows)

Here is the problem: Depending on whether there is an
index or not, 'like' behaves differently. Here is a
transcript:

cddbsql=# select song, metatext(song) from cdsongs
where metatext(song) like metatext('born to run')
limit 1 ;
song | metatext
-+--
 Born To Run | brntorn
(1 row)
 
cddbsql=# create index cdsongs_meta_song on cdsongs
(metatext(song)) ;
CREATE
cddbsql=# select song, metatext(song) from cdsongs
where metatext(song) like metatext('born to run')
limit 1 ;
 song | metatext
--+--
(0
rows)
  

This happens in both 7.0 and
7.1.


__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



[HACKERS] pg_shadow overusage

2001-01-30 Thread Rod Taylor

I'd like to keep a complete history of everything that users of the
system does from the database level (as there are a number of
applications, and backend workers).  I've done this through various
rules, triggers.

The next step is to try to tie a name to it.  getpgusername() supplies
that perfectly.  The real question is, how many users can be in
pg_shadow without the system thrashing.

We're looking to start with approx. 20 000, and will likely grow that
number to 100k users in a years time (I understand a goal for 7.2 is
to get rid of the OID limit :).

Will pg_shadow and the database in general barf with that number of
users in the database?  A limit of 40 simultaneous connections should
suffice for our needs as user sessions will be quite short.

I also want to FOREIGN KEY the usename column in pg_shadow, I'll
assume that adding a unique index won't hurt anything (as I've not
noticed any problems on the test system thus far).

Thanks for any input.

--
Rod Taylor

There are always four sides to every story: your side, their side, the
truth, and what really happened.


BEGIN:VCARD
VERSION:2.1
N:Taylor;Rod;B
FN:Taylor, Rod B
ORG:BarChord Entertainment Inc.;System Operation and Development
TITLE:Chief Technical Officer
ADR;WORK:;;;Toronto;Ontario;;Canada
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Toronto, Ontario=0D=0ACanada
X-WAB-GENDER:2
URL:
URL:http://www.barchord.com
BDAY:19790401
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20010130T192423Z
END:VCARD



[SQL] Re: [HACKERS] 7.1beta4 bug creating a certain table

2001-01-30 Thread Stephan Szabo

On Tue, 30 Jan 2001, Kovacs Zoltan wrote:

  It appears to me that this is correct, since there is no constraint
  on the first column that says that those three columns form a unique
  key *by themselves*.  I believe there were bugs in the code that checked
  for this error before ...
  
  regards, tom lane
  
 I don't know the exact SQL definition whether my declaration is correct or
 not. But, checking our model, we realized that our implementation is not
 correct. So I should rewrite these definitions. Thanks! :-)
 
 But, if this declaration is not correct in the sense of SQL standards, I
 can imagine that PostgreSQL may allow such declarations. (A NOTICE may be
 given instead of an ERROR.) Or, are there any drawbacks of allowing this?

Yes.  The columns *must* be unique because the logic that the foreign keys
are defined to use doesn't really make sense for match unspecified and
match full if they can have duplicates.

You'd need logic like that for match partial for all of the cases for it
to really make sense.  For example, if you can have two pk rows with key
values (1,2) and a fk row (1,2) and you update one of the two pk rows to
(2,3) what happens on an on update cascade?  Match partial still
"requires" that the keys be unique but since fk rows can already match
more than one pk row it's probably not as big a deal.  Of course, match
partial is a real pain because you need to keep stuff around about what
*other* rows were modified during the statement while you're running the
trigger.




Re: [HACKERS] pg_shadow overusage

2001-01-30 Thread Rod Taylor

My mistake.  The index on pg_shadow breaks nearly everything.  I can
have triggers maintain this effectively enough for my needs however.

However, whether or not the number of users I want to add is going to
be too much is still a question.


--
Rod Taylor

There are always four sides to every story: your side, their side, the
truth, and what really happened.
- Original Message -
From: "Rod Taylor" [EMAIL PROTECTED]
To: "Hackers List" [EMAIL PROTECTED]
Sent: Tuesday, January 30, 2001 2:24 PM
Subject: [HACKERS] pg_shadow overusage


 I'd like to keep a complete history of everything that users of the
 system does from the database level (as there are a number of
 applications, and backend workers).  I've done this through various
 rules, triggers.

 The next step is to try to tie a name to it.  getpgusername()
supplies
 that perfectly.  The real question is, how many users can be in
 pg_shadow without the system thrashing.

 We're looking to start with approx. 20 000, and will likely grow
that
 number to 100k users in a years time (I understand a goal for 7.2 is
 to get rid of the OID limit :).

 Will pg_shadow and the database in general barf with that number of
 users in the database?  A limit of 40 simultaneous connections
should
 suffice for our needs as user sessions will be quite short.

 I also want to FOREIGN KEY the usename column in pg_shadow, I'll
 assume that adding a unique index won't hurt anything (as I've not
 noticed any problems on the test system thus far).

 Thanks for any input.

 --
 Rod Taylor

 There are always four sides to every story: your side, their side,
the
 truth, and what really happened.





[HACKERS] Re: Re: [GENERAL] Trouble porting postgreSQL to WinNT

2001-01-30 Thread Fred Yankowski

On Tue, Jan 30, 2001 at 09:41:11AM -0800, Barry Lind wrote:
 Yes I had the same problem, but for me the reason was that I forgot to
 start the ipc-daemon before running initdb.  Last night I had no
 problems installing beta4 on WinNT 4.0.

Also, AFAICT, ipc-daemon must be running under the same NT logon as
the logon that you're using to run initdb (or postmaster), or else
you'll see initdb hang (but use lots of CPU).

This a major PITA for me, because I went by the book (figuratively)
and set up the postgres service to run under a 'postgres' NT logon
account created for just that purpose.  That means I have to run
ipc-daemon logged on as postgres as well.  That's not so bad, but now
when I want to run 'make check' to run regression tests I have to
logon as postgres to do that as well (since the tests run initdb and
postmaster).  Since Cygwin doesn't have any su/sudo (again, AFAICT)
this means logging off my usual development logon, losing all my
pretty windows, and into the postgres login.  (Makes me appreciate
Linux all the more, as if I needed that.)

I don't understand why a single ipc-daemon process can't serve
processes for multiple NT logons at once.  Or can it, and I just don't
have it set up right?

-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA



Re: [HACKERS] Size of TODO.detail

2001-01-30 Thread Lamar Owen

Bruce Momjian wrote:
Lamar Owen wrote: 
  Yow!  Nice stuff in there, that is for sure.  Of course, that's alot of
  space.  What to do? Remove all the unnecessary e-mail headers?
 
 I just tried 'printmail' that strips off most of the unused stuff:
[...]
 Doesn't seem like it saves enough, and it will prevent people from
 reading the mailbox in their mail readers.

Worth a try, at least.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



[HACKERS] Re: Re: [GENERAL] Trouble porting postgreSQL to WinNT

2001-01-30 Thread Peter Mount

At 14:07 30/01/01 -0600, Fred Yankowski wrote:
On Tue, Jan 30, 2001 at 09:41:11AM -0800, Barry Lind wrote:
  Yes I had the same problem, but for me the reason was that I forgot to
  start the ipc-daemon before running initdb.  Last night I had no
  problems installing beta4 on WinNT 4.0.

Also, AFAICT, ipc-daemon must be running under the same NT logon as
the logon that you're using to run initdb (or postmaster), or else
you'll see initdb hang (but use lots of CPU).

Doh! That would explain it (although my CPU was idle).

Anyhow, it's now running (my linux box still has problems - won't connect 
to the net - so I'm having to rely on NT to get JDBC sorted). Oh hum.


This a major PITA for me, because I went by the book (figuratively)
and set up the postgres service to run under a 'postgres' NT logon
account created for just that purpose.  That means I have to run
ipc-daemon logged on as postgres as well.  That's not so bad, but now
when I want to run 'make check' to run regression tests I have to
logon as postgres to do that as well (since the tests run initdb and
postmaster).  Since Cygwin doesn't have any su/sudo (again, AFAICT)
this means logging off my usual development logon, losing all my
pretty windows, and into the postgres login.  (Makes me appreciate
Linux all the more, as if I needed that.)

I can't wait to get the linux box back up. Even though I like JBuilder for 
the IDE, I still prefer Linux for the serious backend stuff.

I don't understand why a single ipc-daemon process can't serve
processes for multiple NT logons at once.  Or can it, and I just don't
have it set up right?

Not sure on that one.

Peter




Re: [HACKERS] Open 7.1 items

2001-01-30 Thread Peter Mount

At 15:02 29/01/01 -0500, Bruce Momjian wrote:
LAZY VACUUM (Vadim)
Runtime btree recovery (Vadim)
JDBC setMaxRows() is global variable affecting other objects

Now fixed. When called from within a Statement it uses its maxrows value, 
but internal queries don't have a restriction.

JDBC LargeObject short read return value missing

Fixed. LargeObject.read(byte[],int,int) now returns the number of bytes 
actualy read.

ODBC not disconnecting properly?
Merge MySQL/PgSQL translation scripts
Fix ipcclean on Linux
unixODBC

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