[GENERAL] Driver

2000-09-05 Thread Enrico Comini

I'm searching for the SOURCES of JDBC DRIVER (for 7.02), precompiled driver
have a bug.
Thanks,
Enrico





[GENERAL] JDBC

2000-09-05 Thread Enrico Comini



Scuse me 

I am interesting in 
a COMPILED debugged version of JDBC driver for 7.02 (driver for J 1.2,1.2 
and1.3).
Thanks,
 
Enrico


Re: [GENERAL] Indexes not working (bug in 7.0.2?)

2000-09-05 Thread Zeljko Trogrlic

Manual says you should use it after initial data entry, after entering a
large amount of rows and periodically.

At 23:02 4.9.2000 , Zlatko Calusic wrote:
Tom Lane [EMAIL PROTECTED] writes:

 Zlatko Calusic [EMAIL PROTECTED] writes:
  It is now NOT using the index, and I don't understand why? Queries are
  practically the same, tables are practically the same, why is postgres
  using indexes in the first case and not in the second?
 
 Because it has substantially different ideas about the sizes of the
 two tables --- notice the different estimated row counts.  If you
 haven't "vacuum analyzed" these tables recently, do so to bring the
 planner's statistics up-to-date, and then see what you get.  You may
 also care to read the user's manual chapter about EXPLAIN,
 http://www.postgresql.org/users-lounge/docs/7.0/postgres/c4888.htm
 

Yes, thanks to all who helped. 'vacuum analyze' was the magical
incantation that helped. 

I still have one uncertainty. Is it possible that after some time
postgres once again decides not to use indices (assuming I haven't run
'vacuum analyze' again)?

-- 
Zlatko




[GENERAL] VACUUM Error

2000-09-05 Thread Hoosain Madhi

I tried to vaccum a table but get the following error :

NOTICE : Child itemid in update-chain marked as unused - can't continue
vc_repair frag.
VACUUM

What is the problem, and how do I over come it??

Thanks 

Hoosain Madhi   
Bsc. Engineering Elec.
Switching Engineering
VODACOM CORPORATE PARK
Tel :   +27 11 653 5030
Fax :   +27 11 653 5941




Re: [GENERAL] JDBC

2000-09-05 Thread Peter Mount



Due to me moving home and my day job taking 
precedence, I've not had chance to do anything since 7.0, so there is no 
difference between 7.0, and 7.0.2.

I'm working though the backlog of patches  bug 
fixes at the moment. I had hoped to have something online last night, but I'm 
still having problems with my internet connection at home (I'm currently 
replying via the works connection), so it's been held back.

As soon as I have something useful (unless a 
disaster occurs it should be this week), I'll be posting an announcement on the 
lists.

Peter

-- Peter T Mount [EMAIL PROTECTED], [EMAIL PROTECTED]Homepage: http://www.retep.org.uk Contact details: http://petermount.comPostgreSQL JDBC: http://www.retep.org.uk/postgres/Java 
PDF Generator: http://www.retep.org.uk/pdf/

  - Original Message - 
  From: 
  Enrico 
  Comini 
  To: ML-Postrges-general 
  Sent: Tuesday, September 05, 2000 10:05 
  AM
  Subject: [GENERAL] JDBC
  
  Scuse me 
  
  I am interesting 
  in a COMPILED debugged version of JDBC driver for 7.02 (driver for J 1.2,1.2 
  and1.3).
  Thanks,
   
  Enrico


[GENERAL] Re: system catalog question

2000-09-05 Thread Zorlac

I'm not familiar with oracle but the command I think you're looking for is
explain.


Eugene [EMAIL PROTECTED] wrote in message
news:8m9o4o$9c4$[EMAIL PROTECTED]...

 Hi all,

 I want to know if there is anything in PostgreSQL like 'DESCRIBE'
 in Oracle. Thanks.

 Eugene





[GENERAL] JDBC and Unicode problem

2000-09-05 Thread Zeljko Trogrlic

Hello,

I'm trying to store / retrieve data from UNICODE database, but without success.

I installet PostgreSQL 7.02 binaries for RedHat Linux on RH 6.2
I created database with UNICODE as charset (createdb -E UNICODE name)
I can establish JDBC connection and everything works fine when I use ASCII
characters.
When I use non-ASCII characters, I get all kind of stuff.

I tried to store data using
 * setString
 * setObject
 * setBytes
 * setUnicodeStream

without success.

My questions are:
 * Are binaries configured for UNICODE support?
 * How can I check are binaries configured for UNICODE support?
 * Do I have to set somethinh in Java in order to get UNICODE working?
 * Which method should I use to read UNICODE data?

I have to enter multilingual data so I can't switch to national character set.
v
Zeljko Trogrlic


Aeris d.o.o.
Sv. Petka 60 b, HR-31000 Osijek, Croatia
Tel: +385 (31) 53 00 15
Email: mailto:[EMAIL PROTECTED]



Re: [GENERAL] 7.1 Release Date

2000-09-05 Thread Sander Steffann

Hi Lamar,

 I was afraid you'd say that. :-)  As long as I can get questions
 answered here about the gory details, and without laughing too hard at
 my missteps, I'll see if I can tackle this.

I think you would make a lot of people very happy with this!
Sander.





[GENERAL] Sequences: How do I set a sequence value?

2000-09-05 Thread David Steuber

Given a sequence n created by creat sequence, how do I set n so that
nextval() will return a specific number on its next call?

-- 
David Steuber | "Are you now, or have you ever been, a member
NRA Member| of the NRA?" --- HUAC, 2004

Happiness is a SAAB Gripen http://www.gripen.saab.se/ in the
garage, an FN-FAL in the safe, and an HK P7M8 on the hip.



[GENERAL] initlocation - server restart

2000-09-05 Thread Jochen Schmidt

hi 
i have the following problem on my Linux, PostgreSQL 6.5.1:

postgres@vogon:~  export PGDATA2="/home/jochen/data"
postgres@vogon:~  initlocation $PGDATA2
We are initializing the database area with username postgres (uid=26).
This user will own all the files and must also own the server process.

Creating Postgres database system directory /home/jochen/data/base


postgres@vogon:~   nohup postmaster -i 
[1] 17270
postgres@vogon:~  createdb -D $PGDATA2 bla
ERROR:  Unable to locate path '/home/jochen/data/bla'
This may be due to a missing environment variable in the server
createdb: database creation failed on bla.

--

I read through the archives but couldn't find an answer to my problem...
thanks in advance, jochen

-- 

.* .
. Dipl. Geogr. Jochen Schmidt*  | |.
.   | | | |.
.   Department of Geography  phone +49/0228/739646  | | | |  * .
. University of Bonn fax   +49/0228/739099  | |_| | | |. 
.   Meckenheimer Allee 166 [EMAIL PROTECTED]   \___  |_| |.
.  D - 53115 Bonn http://slide.giub.uni-bonn.de/~jochen |  ___/.
.   | |.  





[GENERAL] That killer 3rd join...

2000-09-05 Thread Oliver Smith

In order to explore some postgres performance options with table
collation, I decided to use a little experimental dabase to try out
some of the options I saw. What I want to create queries to combine
data from 2+ tables into individual rows.

So - being a bit of an EQ player, I cobbled together a trivial little
database that tries to generate an 'EQ Jewellery' table. It all works
fine, and it works fine under MS Access or mysql. But under Postgres,
it grinds. It chugs.

When I experimented with the database, I found that it only started to
do this when I go to a fourth level of join.

The database can be found here:
 http://www.kfs.org/~oliver/jewellery/dbcreate.sql   Definition
 http://www.kfs.org/~oliver/jewellery/insert.sql Insert statements

As you'll see - it's a pretty small table.


If you do:

 SELECT * FROM jcombo_query WHERE metal_uid = 1 ;
or
 SELECT * FROM jcombo_query jq, metal_types mt
  WHERE mt.metal_name = 'Silver' AND mt.metal_uid = jq.metal_uid ;

There is no delay.

Also doing

 SELECT * from jcombo_query silv, jcombo_query elec
  WHERE silv.metal_uid = 1 AND elec.metal_uid = 2 ;

Still no delay. But add a third join

 SELECT * from jcombo_query silv, jcombo_query elec, jcombo_query gold
  WHERE silv.metal_uid = 1 AND elec.metal_uid = 2 AND gold.metal_uid = 3;

Add a fourth:

 SELECT * from jcombo_query silv, jcombo_query elec, jcombo_query gold,
   jcombo_query plat
  WHERE silv.metal_uid = 1 AND elec.metal_uid = 2 AND gold.metal_uid = 3 AND
plat.metal_uid = 4 ;

And it's painful.

So naturally, when I add the join (stone_types.stone_uid):

 SELECT * from jcombo_query silv, jcombo_query elec, jcombo_query gold,
   jcombo_query plat, stone_types st
  WHERE silv.metal_uid = 1 AND silv.stone_uid = st.stone_uid AND
elec.metal_uid = 2 AND elec.stone_uid = st.stone_uid AND
gold.metal_uid = 3 AND gold.stone_uid = st.stone_uid AND
plat.metal_uid = 4 AND plat.stone_uid = st.stone_uid ;

It takes way way way too long to come back for such a small database.

How can I improve upon this kind of query?


Oliver
-- 
If at first you don't succeed, skydiving is not for you...



[GENERAL] Column name case conversion

2000-09-05 Thread Zeljko Trogrlic

Hello,

I'm getting strange length results for columns with UNICODE data.
I entered following string into database:
abcüäöèæž

First three characters are ASCII, second three are German and third three
are Croatian.

When I execute:
select name, length(name), character_length(name), octet_length(name)
from location
where id = 4

I get:
name = abcüäöèæž (9 characters)
length = 5
character_length = 5
octet_length = 9

OK, maybe my UNICODE is not setup well, but length and character_length
must be 9. I guess octet:length should be at least 12  to 15 (in case
UNICODE is OK).
v
Zeljko Trogrlic


Aeris d.o.o.
Sv. Petka 60 b, HR-31000 Osijek, Croatia
Tel: +385 (31) 53 00 15
Email: mailto:[EMAIL PROTECTED]



Re: [GENERAL] PL/Perl compilation errorRe: [GENERAL] PL/Perl compilation error

2000-09-05 Thread Jan Wieck

Tom Lane wrote:
 Alex Guryanow [EMAIL PROTECTED] writes:
  [root@eaccess plperl]# perl Makefile.PL

 For recent Perl versions you need to do
 perl Makefile.PL POLLUTE=1
 instead.  The src/pl Makefile would've done it that way for you,
 but it looks like that code patch didn't make it to the docs...

 Someone needs to update our Perl code so that it will compile cleanly
 against both newer and not-so-new Perls.  There are notes in our mail
 archives about how to do this (basically "use Devel::PPPort" is the
 long-term answer) but it hasn't gotten to the top of anyone's to-do
 list.

Can someone eventually enlighten me a little?

We'vehad   problems   like   platform/version   dependant
compilation errors with PL/Tcl in the past too, but they  got
fixed  pretty  quick and a reasonable number of people worked
on that all together.

We have frequent compilation error reports with  PL/perl  but
nobody seems to be able/willing to do anything about it.

PL/perl  was  once  highly  requested feature. Now there is a
code base and lesser experienced programmers  could  continue
the work, but nobody does.

What  is  the problem with perl? Are there only alot of users
but no hackers? The frequent fail reports suggest that  there
are  folks  who  want  to  have  that  thing running. I can't
believe that a piece of open  source  software,  that  is  so
popular, is implemented in such an ugly way that nobody has a
clue how to fix that damned thing.

So please tell me why people spend their time  writing  error
reports  again  and  again  instead  of  simply fixing it and
submitting a patch.


Jan

--

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







Re: [GENERAL] 7.1 Release Date

2000-09-05 Thread Elmar Haneke

Trond Eivind Glomsrød wrote:

 No, it's not - it's just not making assumptions like "enough space is
 present to dump everything somewhere" (if you have a multiGB database,
 dumping it to upgrade sounds like a bad idea), "the database server is
 running, so I can just dump the data" etc.

On every big Database-Server there sould be a way do dump the data,
the compressed dump is ways samaller than the files used by the
database. If it is impossible to dump it to disk yopu can dump it to
tape. If you cannot dump your data anywere you should simulate a
disk-crash and restart with an empty database :-)

Elmar



Re: [GENERAL] Upper and Lower case sensitivities

2000-09-05 Thread Poul L. Christiansen

Try using ~*

Her are the General Operators:
http://www.postgresql.org/docs/user/x2125.htm

"Campbell, Scott" wrote:

 Hey,

 Is there a function within postgres that lets you search for both upper and
 lower case at the same time?
 I know of the upper() and lower() functions but if a word has both upper and
 lower case in it it won't be returned by a query.
 Or am I limited to forcing my data to have one case only?

 Thanks
 Scott




[GENERAL] Instability in copying large quantities of data

2000-09-05 Thread fabrizio . ermini

Hi all...

I've a big thorne in my side at the moment.

I'developing a web app based essentially on a set of report. This 
reports are generated from queryes on my client's legacy system. 
For obviuos security reason, my app doesn't interacts directly with 
the main server, but is built around a Postgres DB on a separate 
machine (that is also the web server), and I set up a "poor man's 
replication" that batch transfer data from legacy server to pgsql 
server.

In practice, the legacy server generates ASCII dumps of the data 
necessary for the reports and the zips'em and ftp'em to the web 
server. Then, a little process sheduled in cron get them up and 
COPY them in the pgsql system. I built this process using C and 
LibPQ (if necessary, I can post the code, but is a very simple thing 
and I assume you can figure up how it works).

I used this schema many times for various web app, and I never 
encountered problems (I've got an app built eons ago, based on 
Slack 3.5 and PG 6.3.2, that's housed on a far-away provider and 
that never stopped a single second in all of this time. Wow!).

Now I was trying it on a brand new RH 6.2 with PG 7.0.2, RPM 
version. The problem is that the COPY of the data, apparently, 
sometimes leaves a table in an inconsistent state.
The command doesn't throw any error, but when I try to SELECT or 
VACUUM that table the backend dumps core.  Apparently the only 
thing I can do is drop the table and recreate it. This is 
EXTREMELY unfortunate, since it all must be automated and if I 
can't catch any error condition during the update, than also the web 
app start crashing down... 

Sadly this happens in a very inconsistent way. However, it seems 
that the size of the data file is related to the frequency of the 
problem: and since some of the table dumps are more then 20 
Meg, this is no good news. 

I have not got any log, cause the RPM versions doesn't create 
them, however, I'll try to fix this as soon as possible.

In the meantime, anybody can share some hint on how to resolve 
this nightmare?


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini   Alternate E-mail:
C.so Umberto, 7   [EMAIL PROTECTED]
loc. Meleto Valdarno  Mail on GSM: (keep it short!)
52020 Cavriglia (AR)  [EMAIL PROTECTED]



[GENERAL] Sorting Order NULL values

2000-09-05 Thread Daniel Plasa

Hi everybody!

I just set up a 7.0.2 server with german (de_DE) locale support enabled,
sorting works fine now. However NULL values are always the largest
values and thus beeing sorted to the end of a column.

Is there a possibility to change the sorting order such that NULL values
are considered the smallest values and thus beeing sorted to the
begining of a column?

Will be glad about any answer!

Daniel.



[GENERAL] PostgreSQL slow on Reiserfs?

2000-09-05 Thread Davide G. Borin

Hello all.

I'm trying PostgreSQL 7.02 on Linux with Reiserfs, but I found it A LOT
slower than with Ext2!

Are there some know issues or tips to speed up this configuration?

Read you soon
\  Davide G. Borin
\\ !!Anti-spam shield active!! Cut x's and "eliminami" from address
\\\_



Re: [GENERAL] [Solved] SQL Server to PostgreSQLRe: [GENERAL] [Solved] SQL Server to PostgreSQL

2000-09-05 Thread Jan Wieck

Tom Lane wrote:
 Now that you mention it, though, doesn't TOAST break heapam's assumption
 that char(n) is fixed length?  Seems like we'd better either remove that
 assumption or mark char(n) nontoastable.  Any opinions which is better?

Is  the  saved overhead from assuming char(n) is fixed really
that big that it's worth NOT to gain  the  TOAST  advantages?
After  the  GB  benchmarks  we  know  that we have some spare
performance to waste for such things :-)


Jan

--

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







[GENERAL] Error building JDBC Driver

2000-09-05 Thread Michael Labhard

When attempting to build JDBC 7.0 driver with "make jdbc2 jar", the following
error occurs:

org.postgresql.Connection.java: Can't find class org/postgresql/Field

Any ideas?  Thanks.



Re: [GENERAL] JDBC

2000-09-05 Thread Zeljko Trogrlic

The problem could be in incorrectly implemented getTables.


PostgreSQL JDBC returns null. It's not defined that this column may be null,
like TABLE_CAT and TABLE_SCHEM. Actually, it returns just names, null for
everything else and  "no remarks" for remarks.

 From JDBC documentation:

4. TABLE_TYPE String = table type. Typical types are "TABLE", "VIEW", "SYSTEM
TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". 

The second problem is that getTables returns index names, too, and it probably
shouldn't, I'm not sure how is that specified.

At 11:57 5.9.2000 , Peter Mount wrote: 

 The problem seems to be on how JBuilder is asking JDBC for the list of
 tables. It's on my list of things to check, although it's difficult without a
 copy of JBuilder (with the database components) to play with.
  
 Peter
  
 -- 
 Peter T Mount  mailto:[EMAIL PROTECTED][EMAIL PROTECTED],
 mailto:[EMAIL PROTECTED][EMAIL PROTECTED]
 Homepage: http://www.retep.org.ukhttp://www.retep.org.uk Contact details:
 http://petermount.comhttp://petermount.com
 PostgreSQL JDBC:
 http://www.retep.org.uk/postgres/http://www.retep.org.uk/postgres/
 Java PDF Generator:
http://www.retep.org.uk/pdf/http://www.retep.org.uk/pdf/

 - Original Message - 
 From: mailto:[EMAIL PROTECTED]Enrico Comini 
 To: mailto:[EMAIL PROTECTED]ML-Postrges-general 
 Sent: Monday, September 04, 2000 4:57 PM 
 Subject: [GENERAL] JDBC

 HI,

 I'm having a strange problem connecting to postgres 7.02 using the 
 jdbc driver.  After installing the driver in Jbuilder 3, I'm able 
 to connect to my database but can ONLY see the postgres system indexes 
 in Jbuilder's JDBC Explorer GUI.  I'm unable to see my other database 
 objects (tables, views, etc...) in the JDBC Explorer.  Yet the 
 driver lets me manipulate these unseen objects when I execute sql 
 statements against the database.  Problem is, I'd like to see all my 
 database objects in the JDBC Explorer GUI, not just the system index.

 Has anyone experienced this who can suggest a fix?  Does anyone 
 know if this is due to Jbuilder, the postgresql.Driver, or perhaps a 
 bad configuration?  Thanks. 
 ENRICO



v
Zeljko Trogrlic


Aeris d.o.o.
Sv. Petka 60 b, HR-31000 Osijek, Croatia
Tel: +385 (31) 53 00 15
Email: mailto:[EMAIL PROTECTED]



[GENERAL] Re: images

2000-09-05 Thread Zorlac

You sure can by using BLOBS.
You can do that by reading the perl module docs for Pg;
Read the section on large objects.

From experience, I would definitely recommend that you store the reference
to the file, like a URL or something. That is defiantly the faster way.
Loading things off the file system instead of the database will always be
faster. The only thing you run up against in that case is making sure that
your files and db references remain consistent. But that's not too big of a
deal.



Yves Dorfsman [EMAIL PROTECTED] wrote in message
imo95.61086$[EMAIL PROTECTED]">news:imo95.61086$[EMAIL PROTECTED]...
 Is it possible to save images in postgreSQL ??

 If yes, and in the case of a web site using both postgrSQL and mod_perl,
 is it preferable (faster) to save images in the database, or to simply
 save a reference to the images in the database, but load the image from
 the filesystem ???


 Yves.
 
 Yves Dorfsman[EMAIL PROTECTED]
  http://www.cuug.ab.ca/~dorfsmay





[GENERAL] pq_recvbuf: unexpected EOF on client connection

2000-09-05 Thread Alan

Does anyone know this error?
Need I be concerned, and what can I do about it?





Re: [GENERAL] postgresql 7 user passwords dont work ?????

2000-09-05 Thread Fabrice Scemama

su - postgres
chmod u+w ~/data/pg_hba.conf
vi ~/data/pg_hba.conf
chmod u-w ~/data/pg_hba.conf

Eric Webber wrote:
 
 users dont seem to need password in postgres 7 on red hat linux
 6.2, compiled from source.
 
 I do an:
 
 alter user nsadmin with password 'whatever';
 
 And then when I do an:
 
 psql -u -d mydb
 
 username: nsadmin password: NOTwhatever
 
 IT STILL LETS ME IN 
 
 This should not be so should it ?
 
 please advise, thanks
 
 [EMAIL PROTECTED]
 
 
 Get your own "800" number - Free
 Free voicemail, fax, email, and a lot more
 http://www.ureach.com/reg/tag



Re: [GENERAL] C++ Example

2000-09-05 Thread Trurl McByte

On Tue, 29 Aug 2000 (Yesterday), Miguel Omar Carvajal wrote:

  MOC Hi there,
  MOCI can't find the c++ example in the postgresql distribution. Where can I
  MOC find it on the web?
in PostgreSQL distribution: src/interfaces/libpq++/examples/

  MOC 
  MOC Thanks in advance,
  MOC Miguel Carvajal
  MOC 

-- 
  Trurl McByte, Capt. of StasisCruiser "Prince"
|InterNIC: AR3200   RIPE: AR1627-RIPE|
|--98 C3 78 8E 90 E3 01 35  87 1F 3F EF FD 6D 84 B3--|




[GENERAL] Re: uninstall

2000-09-05 Thread David Steuber

"Dave @ kexis" [EMAIL PROTECTED] writes:

' Is there any easy way to uninstall postgresql? I tried gmake uninstall in
' /usr/src/postgresql-7.0.2/src but thats to uninstall utils ?

See if this works for you:

rm -rf /usr/local/pgsql
rm -rf /var/lib/pgsql

Don't forget the database directory if you keep it somewhere else.  If
you moved the man pages... well have fun.

Why are you getting rid of it?

-- 
David Steuber | "Are you now, or have you ever been, a member
NRA Member| of the NRA?" --- HUAC, 2004

Happiness is a SAAB Gripen http://www.gripen.saab.se/ in the
garage, an FN-FAL in the safe, and an HK P7M8 on the hip.



[GENERAL] VACUUM database gives error

2000-09-05 Thread Hoosain Madhi

I tried to vacuum a database but get the following error. I also tried to
vacuum the individual table tbl_c7links and I get the same error. What is
the problem? The other tables vacuum fine

There are +- 12,000 records in this table

-
FATAL 1:  VACUUM (vc_vacheap): FlushRelationBuffers returned -2
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
connection to server was lost
vacuumdb: vacuum failed





Re: [GENERAL] plpgsql function

2000-09-05 Thread Yury Don

Hello Marcin,

Once, Tuesday, September 05, 2000, 8:42:59 PM, you wrote:

MM Hi,
MM creation of following function works just fine but usage not:):
MM mtldb=# select mtldb_wykonane(0);
MM ERROR:  unexpected SELECT query in exec_stmt_execsql()
MM Can You help me find an error?
MM tia

MM CREATE FUNCTION mtldb_wykonane (integer) RETURNS integer AS  '
MMDECLARE
MM   zlecenie alias for $1;
MM   tls   integer;
MM   twz   integer;
MMBEGIN
MM   SELECT count(*) as ls FROM serwery;
MM   tls:=new.ls;
MM   SELECT count(*) as wz FROM wykonanie
MM  WHERE zadanie_id=zlecenie AND kiedy IS NOT NULL;
MM   twz:=new.wz;

MM   if tlstwz
MM  RETURN -1;
MM   end if;
MM   if tls=twz
MM  RETURN 1;
MM   end if;
MMEND;
MM ' LANGUAGE  'plpgsql' ;

Try

CREATE FUNCTION mtldb_wykonane (integer) RETURNS integer AS  '
   DECLARE
  zlecenie alias for $1;
   tls   integer;
   twz   integer;
BEGIN
   SELECT count(*) as ls into tls FROM serwery;
   SELECT count(*) as wz into twz FROM wykonanie
  WHERE zadanie_id=zlecenie AND kiedy IS NOT NULL;

   if tlstwz
  RETURN -1;
   end if;
   if tls=twz
  RETURN 1;
   end if;
END;
 ' LANGUAGE  'plpgsql' ;

BTW, "NEW" can be used only in trigger procedures.

-- 
Best regards,
 Yury  ICQ 11831432
 mailto:[EMAIL PROTECTED]





Re: [GENERAL] psql: FATAL 1: Index pg_class_relname_index is not a btree

2000-09-05 Thread Tom Lane

[ Sorry for slow response, but this just arrived here.  Are you
subscribed to pgsql-general?  It looks to me like Marc just got round
to approving a week or so's worth of nonmember submissions to the
lists... ]

Karl DeBisschop [EMAIL PROTECTED] writes:
 I came in this morning to find my network monitor reporting a problem
 with one of our databases.
 The error was:
 FATAL 1:  Index pg_class_relname_index is not a btree

Yipes!  That message indicates that the page-zero header of this
index got clobbered, which is bad enough in any case, but especially
so on a critical system index like this one.  The other symptoms
you mention sound like pg_database has been clobbered as well.

I haven't heard of anything like that before.  Considering that you
also mention recent hardware upgrades, I have to wonder if the hardware
dropped the ball.  I don't like blaming hardware problems (for a
software guy, it feels too much like passing the buck) but it seems
like a pretty likely bet here.

If you haven't given up hope and reloaded in the past week, I'd be
willing to help poke into the remains, on the chance that we
might discover something useful.  Let me know off-list.

regards, tom lane