[BUGS] FATAL 1: btree

2000-11-03 Thread Chau, Artemis

> I am using postgressql 6.5.2.  (Please don't tell me to upgrade to 7.0
> because we can't yet).
> I wrote a function, the error I got is 
> FATAL 1:  btree: cannot split if start (2) >= maxoff (1).
> 
> It took me a while to isolate a section of the code.  I suspected the line
> was too lone, so I changed it from
>new.problem := new.problem || ''\n'' || ''Asset Owner
> updated: '' || orig_rec.asset_owner || '' -> '' || new.asset_owner;
> 
> TO
> 
>new.problem := new.problem || ''\n'' || ''Owner updated: ''
> || orig_rec.asset_owner || '' -> '' || new.asset_owner;
> 
> After that I was able to submit it through psql.
> 
> I continued to work on the second version of the function, got the same
> error again.  I decided to reverse to the first version, but when I ran
> the sql file through psql, the same error happens again.
> 
> Here is the code:
> **
> 
> drop function col_upd_asset() \g
> create function col_upd_asset() returns opaque as '
>   DECLARE 
>  orig_rec record;
>  
>   BEGIN 
>  SELECT INTO orig_rec * 
> FROM asset
> WHERE case_num = new.case_num;
>  IF FOUND THEN
> IF new.asset_owner <> orig_rec.asset_owner THEN
> IF orig_rec.asset_owner ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Owner updated:
> -> '' || new.asset_owner;
> END IF;
> IF new.asset_owner ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Owner updated: ''
> || orig_rec.asset_owner || '' -> '';
> END IF;
> IF new.asset_owner IS NOT NULL AND orig_rec.asset_owner IS NOT
> NULL THEN
>new.problem := new.problem || ''\n'' || ''Owner updated: ''
> || orig_rec.asset_owner || '' -> '' || new.asset_owner;
> END IF;
> END IF;
> 
> IF new.short_desc <> orig_rec.short_desc THEN
> IF orig_rec.short_desc ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Hostname updated:
> -> '' || new.short_desc;
> END IF;
> IF new.short_desc ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Hostname updated:
> '' || orig_rec.short_desc || '' -> '';
> END IF;
> IF new.short_desc IS NOT NULL AND orig_rec.short_desc IS NOT
> NULL THEN
>new.problem := new.problem || ''\n'' || ''Hostname updated:
> '' || orig_rec.short_desc || '' -> '' || new.short_desc;
> END IF;
> END IF;
> 
> IF new.asset_type <> orig_rec.asset_type THEN
> IF orig_rec.asset_type ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Asset Type
> updated:  -> '' || new.asset_type;
> END IF;
> IF new.asset_type ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Asset Type
> updated: '' || orig_rec.asset_type || '' -> '';
> END IF;
> IF new.asset_type IS NOT NULL AND orig_rec.asset_type IS NOT
> NULL THEN
>new.problem := new.problem || ''\n'' || ''Asset Type
> updated: '' || orig_rec.asset_type || '' -> '' || new.asset_type;
> END IF;
> END IF;
> 
> IF new.status <> orig_rec.status THEN
> IF orig_rec.status ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Status updated:
> -> '' || new.status;
> END IF;
> IF new.status ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Status updated:
> '' || orig_rec.status || '' -> '';
> END IF;
> IF new.status IS NOT NULL AND orig_rec.status IS NOT NULL THEN
>new.problem := new.problem || ''\n'' || ''Status updated:
> '' || orig_rec.status || '' -> '' || new.status;
> END IF;
> END IF;
> 
> IF new.media_type <> orig_rec.media_type THEN
> IF orig_rec.media_type ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Location updated:
> -> '' || new.media_type;
> END IF;
> IF new.media_type ISNULL THEN
>new.problem := new.problem || ''\n'' || ''Location updated:
> '' || orig_rec.media_type || '' -> '';
> END IF;
> IF new.media_type IS NOT NULL AND orig_rec.media_type IS NOT
> NULL THEN
>new.problem := new.problem || ''\n'' || ''Location updated:
> '' || orig_rec.media_type || '' -> '' || new.media_type;
> END IF;
> END IF;
> 
> IF new.os_ver <> orig_rec.os_ver THEN
> IF orig_rec.os_ver ISNULL THEN
>new.problem := new.problem || ''\n'' || ''OS Version
> updated:  -> '' || new.os_ver;
> END IF;
> IF new.os_ver ISNULL THEN
>new.problem := new.problem || ''\n'' || ''OS Version
> updated: '' || orig_rec.os_ver || '' -> '';
>

[BUGS] relation modified? (fwd)

2000-11-03 Thread Lennert Buytenhek


So.. I assume this isn't normal (postgresql 7.0.2 on linux 2.2.16)?

ERROR:  RelationClearRelation: relation 37799899 modified while in use




Re: [BUGS] FATAL 1: btree

2000-11-03 Thread Tom Lane

"Chau, Artemis" <[EMAIL PROTECTED]> writes:
>> I wrote a function, the error I got is 
>> FATAL 1:  btree: cannot split if start (2) >= maxoff (1).

You are running into limits on the size of a function body.  You can't
safely make the body longer than about 2700 bytes in 6.5.*.  The limit
is about 8K in 7.0, and 7.1 will have effectively no limit.

>> I am using postgressql 6.5.2.  (Please don't tell me to upgrade to 7.0
>> because we can't yet).

You really should upgrade ;-).  In the meantime, your only alternative
is to write shorter functions.  Try splitting the work into multiple
functions...

regards, tom lane



Re: [BUGS] relation modified? (fwd)

2000-11-03 Thread Tom Lane

Lennert Buytenhek <[EMAIL PROTECTED]> writes:
> So.. I assume this isn't normal (postgresql 7.0.2 on linux 2.2.16)?
> ERROR:  RelationClearRelation: relation 37799899 modified while in use

Nope... or at least it's not desirable... there's a thread about this
in progress on pghackers.

regards, tom lane



[BUGS] Unable to compile enterprise version of jdbc-driver

2000-11-03 Thread pgsql-bugs

Grim Iversen ([EMAIL PROTECTED]) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Unable to compile enterprise version of jdbc-driver

Long Description
I checked out all the source from cvs, and tried to compile the jdbc-driver with the 
class "PostgresqlDataSource" included, using the command:

make enterprise

The compile failed, and a look at the source suggests that the moving of the jdbc 
driver from package postgresql to org.postgresql perhaps is to blame.  

Using "make jdbc2" created the standard postgresql.jar file without any errors.

Sample Code


No file was uploaded with this report




Re: [BUGS] waiting for lock?

2000-11-03 Thread Tom Lane

Lennert Buytenhek <[EMAIL PROTECTED]> writes:
> If you send psql a SIGINT, it returns with:
> NOTICE:  Skipping "pg_rules" --- only table owner can VACUUM it
> Cancel request sent
> ERROR:  Query cancel requested while waiting lock
> ulsec=>

> Restarting the server (postgresql 7.0.2) cured all.

Hmph.  Something quit and left a lock set on some table (whatever
VACUUM would've come to after pg_rules), it looks like.  Could be
an artifact of the known bug in 7.0.* that shared memory state isn't
properly cleaned up when a client disconnects in the middle of a
BEGIN block.  That's fixed for 7.0.3, if we ever quit arguing and
push it out the door ;-)

regards, tom lane