Re: [GENERAL] Repeated VACUUM reports same number of deleted rows

2004-10-01 Thread Russell Smith
On Sat, 2 Oct 2004 12:42 am, Tom Lane wrote:
> Russell Smith <[EMAIL PROTECTED]> writes:
> > Should VACUUM report the rows as deleted or say they could not be deleted?
> > Why does it report the same information for three runs in a row?
> 
> I see no pending deletions in that vacuum output:
> 
> > DETAIL:  0 dead row versions cannot be removed yet.
> 
INFO:  vacuuming "filter.access_log_big"
INFO:  index "access_log_url" now contains 5159204 row versions in 74984 pages
DETAIL:  21455 index pages have been deleted, 2 are currently reusable.

I expect that index info not to be the same each vacuum run.  Why are 21455 index 
pages deleted
on runs 1, 2 and 3.

> so I'm not sure why you would expect the output to change.
> 
>regards, tom lane
> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
>http://archives.postgresql.org
> 
> 

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

   http://archives.postgresql.org


[GENERAL] ODBC for PostgreSQL 7.4

2004-10-01 Thread Astha Raj
Hi All,

I want to connect to PostgreSQL 7.4 from my Windows machine. What ODBC
version is needed? Is there any other important settings required? I am very
new to this database.

Thanks,
Astha


---(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] problem getting started with PostgreSQL 8 beta 3 on

2004-10-01 Thread Steve Gollery
Tom,
False alarm -- I just realized that I was picking up the createdb from 
an earlier failed attempt to install 7.4.5. Removing that got me to the 
right command and all is well.

Thanks for the help.
Steve
Tom Lane wrote:
Steve Gollery <[EMAIL PROTECTED]> writes:
I installed Postgres 8 beta 3 on an XP box, with Postgres running as a 
service. TaskManager tells me that postgres and postmaster are both 
running. Using pgAdmin III, I can connect to the server and create 
users, databases, tables, etc.

But at the command line, on the same machine where the service is 
running, executing
	createdb mydb
gives this:

could not connect to database template1: could not connect to server:
No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Steve: try
createdb -h localhost mydb
Pghackers: I'm surprised that we don't have libpq set to default to
"localhost" rather than a Unix socket on platforms that haven't got Unix
sockets.  A default that's guaranteed not to work seems a bit useless.
Anyone have a better idea than "localhost"?
			regards, tom lane
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [GENERAL] problem getting started with PostgreSQL 8 beta 3 on XP

2004-10-01 Thread Tom Lane
Steve Gollery <[EMAIL PROTECTED]> writes:
> I installed Postgres 8 beta 3 on an XP box, with Postgres running as a 
> service. TaskManager tells me that postgres and postmaster are both 
> running. Using pgAdmin III, I can connect to the server and create 
> users, databases, tables, etc.
>
> But at the command line, on the same machine where the service is 
> running, executing
>   createdb mydb
> gives this:
>
> could not connect to database template1: could not connect to server:
> No such file or directory
>   Is the server running locally and accepting
>   connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Steve: try
createdb -h localhost mydb

Pghackers: I'm surprised that we don't have libpq set to default to
"localhost" rather than a Unix socket on platforms that haven't got Unix
sockets.  A default that's guaranteed not to work seems a bit useless.

Anyone have a better idea than "localhost"?

regards, tom lane

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


Re: [GENERAL] Upgrade 7.3.3 to 7.4.5

2004-10-01 Thread Tom Lane
"Igor Kryltsov" <[EMAIL PROTECTED]> writes:
> I upgraded recently DB and found that some columns with type "timestamp"
> changed default values from now() to:
>  receipt_date  | timestamp with time zone | not null default
> '2004-09-29 09:58:03.010678+10'::timestamp with time zone

Those were not defined as "default now()".  More likely they were
defined as "default 'now'", which doesn't work anymore.  See the release
notes.

regards, tom lane

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

   http://archives.postgresql.org


Re: [GENERAL] error connecting to database

2004-10-01 Thread Tom Lane
Alexander Cohen <[EMAIL PROTECTED]> writes:
> What kind of permissions does /tmp need?

Generally it's 777 (ie, wide open), plus stickybit if your system
supports that (so people can't delete each others' temp files).

regards, tom lane

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


[GENERAL] about "pg_dump " without pompt password

2004-10-01 Thread Ying Lu
Hello all,
Is it possible that we setup the password in the pg_dump command line 
instead of let users input it through prompt command. E.g.,

  pg_dump test -c -d --host=localhost -U testUser1 --file='a.dmp' 
--no-privileges

Thanks a lot!
Ly

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


Re: [GENERAL] Undefined symbols: _poll

2004-10-01 Thread David Helgason
On 30. sep 2004, at 21:35, Joe Lester wrote:
I'm just moved my Postgres client project from Mac 10.2.8 to 10.3.5. 
It's an Objective-C program that links to libpq.a (the header file is 
libpq-fe.h). However, when I try to compile now I get the following 
linking error:

ld: Undefined symbols: _poll
Does this sound familiar to anyone? My guess is that _poll is 
referenced somewhere in libpq.a. Anyone have any ideas on how to get 
the linking happening on Mac OS 10.3.5?
We had the same problem. In our case the trick was to compile libpq on 
OS X 10.3. The poll function was added in 10.3 (it's based on the 
select function, but at least it exists).

Reading the description of your problem it sounds different.
d.
--
David Helgason,
Business Development et al.,
Over the Edge I/S (http://otee.dk)
Direct line +45 2620 0663
Main line +45 3264 5049
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


[GENERAL] Large update operations and performance

2004-10-01 Thread Jon Asher



I'm running some 
very large table update operations (on 2 mil + records) and the queries are 
taking 5 + hours to complete.  Is there a way to turn off row-level 
index updates or something else to make it run more 
quickly?
 
Jon


[GENERAL] initdb on Debian

2004-10-01 Thread Randall Smith
I would like to be able to initdb to get a clean database to test 
backups.  Reading the Debian version of the Postgresql README, I see 
that I should use the --debian-conffile option with initdb.  Problem 
though.  I have to run initdb as user postgres, but I need to be root to 
edit the stuff in /etc.  So I can't run initdb as root or postgres.  I 
lose either way.  Also, since the configs are symlinked in etc, is there 
an elegant way to handle the configs in /etc when I'm running > 1 
postgresql instances?

Randall
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


[GENERAL] problem getting started with PostgreSQL 8 beta 3 on XP

2004-10-01 Thread Steve Gollery
I installed Postgres 8 beta 3 on an XP box, with Postgres running as a 
service. TaskManager tells me that postgres and postmaster are both 
running. Using pgAdmin III, I can connect to the server and create 
users, databases, tables, etc.

But at the command line, on the same machine where the service is 
running, executing

createdb mydb
gives this:
could not connect to database template1: could not connect to server:
No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The documentation says:
"This means that the server was not started, or it was not started where 
createdb expected it."

Since pgAdmin has no trouble connecting, I assume that the server is 
running and receiving connections at port 5432, so that leaves the 
second part: not started where createdb expected it.

I've tried explicitly including the host, port, user, password, and that 
doesn't help.

Any ideas what's going wrong here?
Steven Gollery
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[GENERAL] Upgrade 7.3.3 to 7.4.5

2004-10-01 Thread Igor Kryltsov
Hi,

I upgraded recently DB and found that some columns with type "timestamp"
changed default values from now() to:
 receipt_date  | timestamp with time zone | not null default
'2004-09-29 09:58:03.010678+10'::timestamp with time zone

,where time is a time when psql -U postgres template1 < db_backup.sql was
executed.

I want to underline not all "timestamp default now()" columns but only some
of them.

Any ideas?


Thank you,

Igor







---(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] zero-length delimited identifier in pg_dumpall file

2004-10-01 Thread Randall Smith
Got this error on a pg_dumpall file dumped from a postgresql-7.4-0.3PGDG 
database and imported into 7.4.5-3 database.

ERROR:  zero-length delimited identifier at or near  at character 37
From looking at the output, I think maybe this is the line that caused 
the error.

CREATE SCHEMA "MSV80" AUTHORIZATION "";
There is another statement a few lines down that looks like this:
CREATE SCHEMA msv80 AUTHORIZATION dba;
Is this a but in the pg_dumall program?
Randall
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [GENERAL] error connecting to database

2004-10-01 Thread Alexander Cohen
On 1-Oct-04, at 3:06 PM, Tom Lane wrote:
Alexander Cohen <[EMAIL PROTECTED]> writes:
Could not connect to server: permission denied.
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"

What exctly does this error message mean? What permissions is this
error talking about?
The permissions on the socket file /tmp/.s.PGSQL.5432.
Ordinarily the postmaster will create the socket as world-writable,
but evidently not this time.  Perhaps you have set a nonstandard value
for "unix_socket_permissions"?  Another possibility is that it's not
the socket file itself, but /tmp that is mis-permissioned.
What kind of permissions does /tmp need?
Alex
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [GENERAL] error connecting to database

2004-10-01 Thread Tom Lane
Alexander Cohen <[EMAIL PROTECTED]> writes:
> Could not connect to server: permission denied.
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"

> What exctly does this error message mean? What permissions is this 
> error talking about?

The permissions on the socket file /tmp/.s.PGSQL.5432.

Ordinarily the postmaster will create the socket as world-writable,
but evidently not this time.  Perhaps you have set a nonstandard value
for "unix_socket_permissions"?  Another possibility is that it's not
the socket file itself, but /tmp that is mis-permissioned.

regards, tom lane

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


Re: [GENERAL] newby question

2004-10-01 Thread Scott Frankel
Good to know ...
Scott
On Oct 1, 2004, at 9:08 AM, Doug McNaught wrote:
Scott Frankel <[EMAIL PROTECTED]> writes:
Additional note:  configure warned of an old version of bison when I
attempted an install of postgresql7.4.5 the other day.  Seems the
version
that comes with OSX 10.3.x is too old for postgres.
You only actually need Bison if you are building from CVS--the release
tarballs are pre-Bisonated, so you can ignore that warning.  :)
-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

---(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] Random not so random

2004-10-01 Thread Greg Stark

"Arnau Rebassa" <[EMAIL PROTECTED]> writes:

>select * from messages order by random() limit 1;
> 
> in the table messages I have more than 200 messages and a lot of times, the
> message retrieved is the same. Anybody knows how I could do a more "random"
> random?

What OS is this? Postgres is just using your OS's random()/srandom() calls. On
some platforms these may be poorly implemented and not very random.

However of the various choices available I think random/srandom are a good
choice. I'm surprised you're finding it not very random.

Incidentally, are you reconnecting every time or is it that multiple calls in
a single session are returning the same record? It ought not make a difference
as Postgres is careful to seed the random number generator with something
reasonable though.

In a quick test of my own on linux with glibc 2.3.2.ds1 (no, I have no idea
what the ds1 means) It seems fairly random to me:

 test=> create table test4 as (select (select case when b.b then a else a end from 
test  order by random() limit 1) as b from b limit 1000);
 SELECT
 test=> select count(*),b from test4 group by b;
  count | b 
 ---+---
210 | 5
195 | 4
183 | 3
203 | 2
209 | 1
 (5 rows)

 And the same thing holds if I test just the low order bits too:

 test=> create table test4 as (select (select case when b.b then a else a end from 
test  order by random() limit 1) as b from b limit 1000);
 SELECT
 test=> select count(*),b from test4 group by b;
  count | b 
 ---+---
249 | 4
241 | 3
259 | 2
251 | 1
 (4 rows)

-- 
greg


---(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] error connecting to database

2004-10-01 Thread sklassen
* Alexander Cohen <[EMAIL PROTECTED]> [2004-10-01 14:42:07 -0400]:

> Im trying to connect locally to a database on a running postgres 
> cluster. If i connect with psql, everything is fine and i can transact. 
> I i try and connect in my own app, i get this error:
> 
> Could not connect to server: permission denied.
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"
>
> I know for a fact postgres is running, i can see with  and also
>  in the terminal on Mac OSX 10.3.5.

Try 'netstat -ntpl' intead to see if it's listening.

> What exctly does this error message mean? What permissions is this
> error talking about?

That typically means that you're connecting via the local unix socket
instead of the tcp port. If your application is trying to do the
latter you'll want to uncomment the tcp_socket setting in
postgresql.conf and restart.

-- 
Steven Klassen - Lead Programmer
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Replication & Support Services, (503) 667-4564

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


[GENERAL] error connecting to database

2004-10-01 Thread Alexander Cohen
Im trying to connect locally to a database on a running postgres 
cluster. If i connect with psql, everything is fine and i can transact. 
I i try and connect in my own app, i get this error:

Could not connect to server: permission denied.
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"
I know for a fact postgres is running, i can see with  and also 
 in the terminal on Mac OSX 10.3.5.

What exctly does this error message mean? What permissions is this 
error talking about?

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


[GENERAL] Pgadmin III Qustion

2004-10-01 Thread Laurent Duperval
HI,
I'm using pgadmin III 1.2.0 Post Beta 1 (Sept 17 2004). I used it to execute 
a SQL script that creates tables and inserts data. At the end, I get a 
message saying that everything went through correctly. However, when I try 
to view the data in the pgadmin window, nothing shows up.

My backend is PG 8.0 Beta 2 on Windows 2000.
Any ideas on what the problem could be?
Thanks,
L
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [GENERAL] Aggregates ?? Datamart (to whatever it has implemented a DataMart using Postgres)

2004-10-01 Thread Alvaro Herrera
On Mon, Sep 27, 2004 at 07:04:50PM -0400, Esteban Kemp wrote:

Esteban,

>   I'm building a Large DataMart with a big table and I want to improve
>   the performace using aggregates I mean a set of table that store
>   some specific aggregacion of the main table, like materialized
>   views, I know that this feature is not implemented yet in postgres,
>   And I see a interesting article to implementing this using a set of
>   triggers, but I thing the big problem is not the rate of the updates
>   or the real time consistence between both table, the main and the
>   agregates. I thing the really problem is how to let it know to the
>   RDMS engine that this aggregates exist!, I mean when I run a query I
>   want to the Database engine run the query against the correct table.

I think you may be interested in reading "Materialized Views in
PostgreSQL" by Jonathan Gardner.

http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html


You may also want to subscribe to the pgsql-es-ayuda, at
http://archives.postgresql.org/pgsql-es-ayuda.  We can discuss further
there without the language barrier ...

-- 
Alvaro Herrera ()
Este mail se entrega garantizadamente 100% libre de sarcasmo.


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


Re: [GENERAL] PostgreSQL 8.0.0 Beta 3 Uploaded

2004-10-01 Thread Marian POPESCU
Are there also SRPMs? I'm interested on Fedora Core 2 ones. I have rebuilt
from SRPMs the Beta2 and it works OK -  I only had to change the init
script - the version provided was 7.4.

Marian


---(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 installer beta2 dev2 / dev3 freeze

2004-10-01 Thread bartkoedith
Hello folks,

I am having a hard time installing PgSQL on WinXP - when installing from
source it tells me I have an incompatible time zone - PgSQL does not
support leap seconds (Europe - Bratislava, Budapest, Berlin, etc.), when
installing via installer dev2 and/or dev3 freezes.

ver says: 5.1.2600, WinXP SK, SP2 installed.

Any suggestions are welcome.

Cheers

Zoltan

PS: be patient with me, I know Linux better than this XP thing.


---(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] Random not so random

2004-10-01 Thread Jean-Luc Lachance
Use a SERIAL id on messages, then
Select * from messages
where id = int8( random() * currval({sequence_name}));
Arnau Rebassa wrote:
Hi everybody,
I'm doing the following query:
  select * from messages order by random() limit 1;
in the table messages I have more than 200 messages and a lot of times, 
the message retrieved is the same. Anybody knows how I could do a more 
"random" random?

Thank you very much
--
Arnau
_
Consigue aquí las mejores y mas recientes ofertas de trabajo EE.UU. 
http://latino.msn.com/empleos

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


[GENERAL] Arjunt......

2004-10-01 Thread Ashok......
hi! 
Everybody.

I have written a code to connec to  postgre sql
databse.But i am geting some error.

import java.sql.*; 
import java.util.*; 
import java.lang.*; 



public class LoginPage { 
  public static void main(String[] args) 
  { 
Connection conn; 
try 
{ 

Class.forName("org.postgresql.Driver"); 
  String url =
"jdbc:postgresql://localhost:5432/test"; 
  conn = DriverManager.getConnection(url,
"postgres", "viwotec"); 

 
  Statement s = conn.createStatement(); 
  ResultSet r = s.executeQuery("select
oid,id,name,password from myschema.login"); 
  while( r.next() ) 
  { 


int id = r.getInt(2);
System.out.println("Row " + id + ":"); 

   int oid = r.getInt(2);
System.out.println("Rowoid " + oid + ":"); 

/*String nam = r.getString();
System.out.println("Name of the person" + nam
+ ":"); 

String pass = r.getString();
System.out.println("Password you entered was"
+ pass + ":"); */

  }
  s.close(); 
  conn.close(); 
} 
catch( Exception e ) 
{ 
  e.printStackTrace(); 
}  
  }
}


and the error is
java.lang.ClassNotFoundException:
org.postgresql.Driver
at
java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at LoginPage.main(LoginPage.java:14)

please tell me solution for this...How i can load the
driver and where

--- Shachar Shemesh <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] wrote:
> 
> >Hi,
> >
> >I'm looking for details, or tools about porting a
> full Ms Sql Server
> >2000 database to Postgres on Linux.
> >
> >Is this possible?  We have the whole nine yards,
> stored procedures,
> >triggers, and all.  
> >
> >Is there a way to automate this process?
> >
> >Thanks
> >  
> >
> Totally automate - no.
> 
> There are tools to help you along, however. They
> are not as complete as 
> I would like them, and I need lots of help in
> maintaining the site. It's 
> located at http://pgfoundry.org/projects/sql2pg/,
> but there are 
> currently no released files. In CVS, however, you
> will find a perl 
> script that translates the exported database
> description from MS SQL to 
> a more-or-less PG friendly format. Also you will
> find there support for 
> two data types - varcharci (case insensitive) and
> utinyint (1 byte 
> unsigned integer).
> 
> Any help with maintaining this project would be
> greatly appreciated.
> 
> I do have a few questions for you. What drivers do
> you currently use to 
> access your database? Do you use the stored
> procedure's ability to 
> return more than one result?
> 
> Shachar
> 
> -- 
> Shachar Shemesh
> Lingnu Open Source Consulting ltd.
> http://www.lingnu.com/
> 
> 
> ---(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
> 




__
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

---(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] Postgresql commands to display all functions and process/connections based on a database.

2004-10-01 Thread sklassen
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2004-09-28 17:28:25 -0400]:

> . List all functions have been defined (e.g., defined through
> pg/sql) within a database

SELECT proname FROM pg_proc JOIN pg_language ON (pg_proc.prolang =
pg_language.oid) WHERE pg_language.lanname = 'plpgsql';

-- 
Steven Klassen - Lead Programmer
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Replication & Support Services, (503) 667-4564

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


[GENERAL] Random not so random

2004-10-01 Thread Arnau Rebassa
Hi everybody,
I'm doing the following query:
  select * from messages order by random() limit 1;
in the table messages I have more than 200 messages and a lot of times, the 
message retrieved is the same. Anybody knows how I could do a more "random" 
random?

Thank you very much
--
Arnau
_
Consigue aquí las mejores y mas recientes ofertas de trabajo EE.UU. 
http://latino.msn.com/empleos

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


Re: [GENERAL] checksum

2004-10-01 Thread Henriksen, Jonas F
Hi, 

not sure I quite understand, but could you not just concatenate all the fields and 
test on that? like: 

select test1, test2, test3 from testtable 
where test1 || test2 || test3 = 'whateveryouwanttotest'

you might have to do some typecasting/conversion on data types other than strings...

regards Jonas:))

-Original Message-
From: Federico Balbi [mailto:[EMAIL PROTECTED]
Sent: 26. september 2004 20:32
To: postgresql-general
Subject: Re: checksum


> David Helgason wrote:
>
> >>   I was wondering if PGSQL has a function similar to
> >> binary_checksum() of
> >> MS SQL Server 2000. It is pretty handy when it comes to compare rows of
> >> data instead of having to write long boolean expressions.
> >> binary_checksum() takes a list of fields and it returns an integer value
> >> which sumarize the row content.
> >
> >
> You could use the md5 function such as :
>
> select md5(foo) from bar where baz = 2;

Looks like md5() takes only a string. I need to pass alist of fields
instead. I was looking at the documentattion and I think I can write
soemthing like:

field1, field2, ..., fieldn = expr1, expr2, ..., exprn

This way one operator will check all the fields for equality.

Fed


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


[GENERAL] Postgresql commands to display all functions and process/connections based on a database.

2004-10-01 Thread ying_lu
Hello,

Could someone help tell the commands of the following operation under postgreSQL
please?

. List all functions have been defined (e.g., defined through pg/sql) within a
database
. Display all process/connections (similar to show processlist under MySQL)

Thanks in advance,
Ly


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


Re: [GENERAL] Hardware recommendations

2004-10-01 Thread Barry S
Gentoo, in my opinion, makes a poor production platform. Others have had 
success with it, but I would recommend 1 of the big 3 'stable' linux 
platforms out there:

* RHES
* SUSE
* Debian
As far as hardware goes, IBM has some nice x86 intro servers that fit 
into that price catagory.

-Barry
John wrote:
I need to get a server to run Postgres, Sun's AS8 and nothing else. I am 
favouring Linux and am aiming for a cheap server (around £900 / $1600). 
Does anyone have recommendations for a) Hardware and b) Distro. I am 
inclined to use Gentoo, but that's only because I'm used to it.

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


[GENERAL] is it Distributed Database

2004-10-01 Thread Rahat Ali
Hi,
I want to develop my project in postgresql database
but my project requirement is Distributed Database so
please guide me that postgresql can sport Distributed
Database system and Centralized Database System, if
yes then please inform me that which postgresql
version should i used and also please send some link
where from i can get guide that how to develop this
type ot database applications in postgresql Database.

=
 Rahat Ali Awan



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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

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


Re: [GENERAL] Free Unix-Like ODBC Driver Manager For Win32?

2004-10-01 Thread Thomas Kellerer
Randy Yates wrote on 27.09.2004 01:35:
Hi,
I want to do develop some C++ to interface with a remote postgresql
database via ODBC on a win32 platform (windows 2000) via unix
style. For example, I like using the mingw (minimum gnus for windows)
distribution, gnumake, xemacs, cygwin, and non-IDE building.
Will the iODBC driver manager work under such an environment in win32?
If not, is there something that will?
If you are working with win32, why do you need a separate driver manager? 
To my knowledge they all come with an ODBC manager...

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


Re: [GENERAL] newby question

2004-10-01 Thread Doug McNaught
Scott Frankel <[EMAIL PROTECTED]> writes:

> Additional note:  configure warned of an old version of bison when I
> attempted an install of postgresql7.4.5 the other day.  Seems the
> version
> that comes with OSX 10.3.x is too old for postgres.

You only actually need Bison if you are building from CVS--the release
tarballs are pre-Bisonated, so you can ignore that warning.  :)

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

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

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


[GENERAL] Free Unix-Like ODBC Driver Manager For Win32?

2004-10-01 Thread Randy Yates
Hi,

I want to do develop some C++ to interface with a remote postgresql
database via ODBC on a win32 platform (windows 2000) via unix
style. For example, I like using the mingw (minimum gnus for windows)
distribution, gnumake, xemacs, cygwin, and non-IDE building.

Will the iODBC driver manager work under such an environment in win32?
If not, is there something that will?
-- 
%  Randy Yates  % "And all that I can do
%% Fuquay-Varina, NC%  is say I'm sorry, 
%%% 919-577-9882%  that's the way it goes..."
 <[EMAIL PROTECTED]>   % Getting To The Point', *Balance of Power*, ELO
http://home.earthlink.net/~yatescr

---(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] porting a full Ms Sql Server to postgres

2004-10-01 Thread Shachar Shemesh
[EMAIL PROTECTED] wrote:
Hi,
I'm looking for details, or tools about porting a full Ms Sql Server
2000 database to Postgres on Linux.
Is this possible?  We have the whole nine yards, stored procedures,
triggers, and all.  

Is there a way to automate this process?
Thanks
 

Totally automate - no.
There are tools to help you along, however. They are not as complete as 
I would like them, and I need lots of help in maintaining the site. It's 
located at http://pgfoundry.org/projects/sql2pg/, but there are 
currently no released files. In CVS, however, you will find a perl 
script that translates the exported database description from MS SQL to 
a more-or-less PG friendly format. Also you will find there support for 
two data types - varcharci (case insensitive) and utinyint (1 byte 
unsigned integer).

Any help with maintaining this project would be greatly appreciated.
I do have a few questions for you. What drivers do you currently use to 
access your database? Do you use the stored procedure's ability to 
return more than one result?

   Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/
---(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] newby question

2004-10-01 Thread Scott Frankel
Additional note:  configure warned of an old version of bison when I
attempted an install of postgresql7.4.5 the other day.  Seems the 
version
that comes with OSX 10.3.x is too old for postgres.

Only trick I encountered in installing bison from tarball was locating 
the
install product in /usr/local/bin and copying it to /usr/bin (either 
because
that's where postgres wants to find it, or because my path does not 
include
/usr/local).

Scott

On Oct 1, 2004, at 7:26 AM, Kevin Barnard wrote:
Apache/PHP are already prebuilt on Mac OS X.  All you need to do is
donwload the postgres tarball config and compile.
Small notte on the compile.  When you compile postgres either turn off
readline support or download readline from GNU and compile the static
lib.
I don't remember off hand but I think an older version of Postgres is
compiled into the standard Mac PHP.  If not it is fairly easy to
recomiple PHP on the Mac.  If you have any further questions about
compiling ask  I can walk you though it if you need.
On Fri, 01 Oct 2004 11:45:18 +0100, Richard Huxton <[EMAIL PROTECTED]> 
wrote:
Bernd Buldt wrote:
Howdy!   I'd like to set up a database (mostly a bibliography), which
I'd like to connect to a webpage such that simple queries to the
database can be made by visitors of my homepage.  I seem to remember
that FileMaker allows for this, but I'd prefer a UNIX-based solution
(under MacOS X).  Hence my question (before I start digging):   Can
anyone on the list confirm that this is doable (w/o too much hassles 
)
with PostGresQL?  Thx for your time!  Best,  Bernd
Can't say I've done it with MacOS-X, but Apache+PHP+PostgreSQL are a
common combination. Worth checking sourforge.net / freshmeat.net and 
see
if there are any projects doing what you want before starting your own
though.

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

   http://www.postgresql.org/docs/faqs/FAQ.html
---(end of 
broadcast)---
TIP 5: Have you checked our extensive FAQ?

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

---(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] Bug with updateable Views and inherited tables?

2004-10-01 Thread Tom Lane
=?ISO-8859-1?Q?Sebastian_B=F6ck?= <[EMAIL PROTECTED]> writes:
> Is this a known limitation with views, rules and
> inherited tables i haven't heard of? Or is it a bug?

When you haven't shown us any details, it's impossible to tell.
Let's see the actual table, view, and rule definitions.  (pg_dump -s
output would be good.)

regards, tom lane

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

   http://archives.postgresql.org


Re: [GENERAL] Repeated VACUUM reports same number of deleted rows

2004-10-01 Thread Tom Lane
Russell Smith <[EMAIL PROTECTED]> writes:
> Should VACUUM report the rows as deleted or say they could not be deleted?
> Why does it report the same information for three runs in a row?

I see no pending deletions in that vacuum output:

> DETAIL:  0 dead row versions cannot be removed yet.

so I'm not sure why you would expect the output to change.

regards, tom lane

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

   http://archives.postgresql.org


Re: [GENERAL] newby question

2004-10-01 Thread Kevin Barnard
Apache/PHP are already prebuilt on Mac OS X.  All you need to do is
donwload the postgres tarball config and compile.

Small notte on the compile.  When you compile postgres either turn off
readline support or download readline from GNU and compile the static
lib.

I don't remember off hand but I think an older version of Postgres is
compiled into the standard Mac PHP.  If not it is fairly easy to
recomiple PHP on the Mac.  If you have any further questions about
compiling ask  I can walk you though it if you need.


On Fri, 01 Oct 2004 11:45:18 +0100, Richard Huxton <[EMAIL PROTECTED]> wrote:
> Bernd Buldt wrote:
> > Howdy!   I'd like to set up a database (mostly a bibliography), which
> > I'd like to connect to a webpage such that simple queries to the
> > database can be made by visitors of my homepage.  I seem to remember
> > that FileMaker allows for this, but I'd prefer a UNIX-based solution
> > (under MacOS X).  Hence my question (before I start digging):   Can
> > anyone on the list confirm that this is doable (w/o too much hassles )
> > with PostGresQL?  Thx for your time!  Best,  Bernd
> 
> Can't say I've done it with MacOS-X, but Apache+PHP+PostgreSQL are a
> common combination. Worth checking sourforge.net / freshmeat.net and see
> if there are any projects doing what you want before starting your own
> though.
> 
> --
>Richard Huxton
>Archonet Ltd
> 
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
> 
>http://www.postgresql.org/docs/faqs/FAQ.html
>

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

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


Re: [GENERAL] How to debug pl/pgSQL -script?

2004-10-01 Thread Alvaro Herrera
On Fri, Oct 01, 2004 at 03:05:14PM +0200, Henriksen, Jonas F wrote:

> I'm writing some simple triggers and functions for a postgres
> database, and I'm wondering how to go about to debug a
> pl/pgSQL-script. Is there a way to echo variable-content to screen, or
> to file? Or is there other, more advanced ways of debugging such
> scripts? 

Yes, use RAISE NOTICE.  See the docs -- it takes a string which can have
% in them, like printf %-escapes but without the modifiers.

-- 
Alvaro Herrera ()
"Postgres is bloatware by design: it was built to house
PhD theses." (Joey Hellerstein, SIGMOD annual conference 2002)


---(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] How to debug pl/pgSQL -script?

2004-10-01 Thread ra
Hi,
 http://www.postgresql.org/docs/7.4/static/plpgsql-errors-and-messages.html

Albert

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

   http://archives.postgresql.org


[GENERAL] How to debug pl/pgSQL -script?

2004-10-01 Thread Henriksen, Jonas F
Hi, 
I'm writing some simple triggers and functions for a postgres database, and I'm 
wondering how to go about to debug a pl/pgSQL-script. Is there a way to echo 
variable-content to screen, or to file? Or is there other, more advanced ways of 
debugging such scripts? 

regards Jonas:))

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


[GENERAL] Bug with updateable Views and inherited tables?

2004-10-01 Thread Sebastian Böck
Hello all,
i have a view defined as a simple select of a table.
This table is inherited by a couple of others.
All entries belong to the child-tables.
I also have an unconditional update rule on the view.
If i do an update to the view, the update is rewritten
to update the father-table.
And now a strange thing is happening:
If i do an update, this update is done correctly only
on the first defined child-table. If it applies to
one of the other 8 child-tables nothing happens at all.
If i update the father-table directly everything is
working like expected (the update is "directed" to the
right table).
Is this a known limitation with views, rules and
inherited tables i haven't heard of? Or is it a bug?
My Postgres is version 7.4.5.
Thanks in advance
Sebastian
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [GENERAL] newby question

2004-10-01 Thread Richard Huxton
Bernd Buldt wrote:
Howdy!   I'd like to set up a database (mostly a bibliography), which 
I'd like to connect to a webpage such that simple queries to the 
database can be made by visitors of my homepage.  I seem to remember 
that FileMaker allows for this, but I'd prefer a UNIX-based solution 
(under MacOS X).  Hence my question (before I start digging):   Can 
anyone on the list confirm that this is doable (w/o too much hassles ) 
with PostGresQL?  Thx for your time!  Best,  Bernd
Can't say I've done it with MacOS-X, but Apache+PHP+PostgreSQL are a 
common combination. Worth checking sourforge.net / freshmeat.net and see 
if there are any projects doing what you want before starting your own 
though.

--
  Richard Huxton
  Archonet Ltd
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [GENERAL] i'm really desperate: invalid memory alloc request

2004-10-01 Thread Richard Huxton
Janning Vygen wrote:
Hi Richard,
i feared all db gurus are asleep at the moment. 
They are, that's why you've got me :-)
Am Freitag, 1. Oktober 2004 10:56 schrieb Richard Huxton:
PS - your next mail mentions sig11 which usually implies hardware
problems, so don't forget to test the machine thoroughly once this is over.
You saved my life!! Nothing less!
This was a great help cause i never thought that it could be a hardware 
problem. I took a dump from last night and tried to recover on the original 
machine. it didnt work as i wrote. but when i tried to install it on another 
machine it just worked fine.

So everything is up and running. 

I still have all the corrupt files in place and now  i try to determine what 
went wrong. 

As it is obviously a hardware problem, my question is now: how can i check my 
hardware (disk)?

How can i get informed next time when things are going wrong?
Well, it might be memory too. You probably want to run memtest86 for a 
day or two. Bonnie++ is disk performance rather than testing, but will 
stress the system.
  http://www.linuxtested.com/linux_tools.html

Many modern drives offer SMART disk monitoring - google for tools to 
display the relevant statistics.

Ok i will come up with a lot of questions as soon as i had another coffee 
because i never want to feel so helpless again. 

There really should be a section in the manual like "desaster recovery" which 
shows some tricks and methods. 
It doesn't happen often enough to warrant a chapter, but someone should 
write something step-by-step.

pg version is 7.4.2
Download 7.4.5 - that's got the latest bugfixes in it.
i will as soon as my nerves are cooling down again :-)
Nice to be able to stop screaming, isn't it ;-)
--
  Richard Huxton
  Archonet Ltd
---(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] i'm really desperate: invalid memory alloc request size 0

2004-10-01 Thread Janning Vygen
Hi Richard,

i feared all db gurus are asleep at the moment. 

Am Freitag, 1. Oktober 2004 10:56 schrieb Richard Huxton:
> PS - your next mail mentions sig11 which usually implies hardware
> problems, so don't forget to test the machine thoroughly once this is over.

You saved my life!! Nothing less!

This was a great help cause i never thought that it could be a hardware 
problem. I took a dump from last night and tried to recover on the original 
machine. it didnt work as i wrote. but when i tried to install it on another 
machine it just worked fine.

So everything is up and running. 

I still have all the corrupt files in place and now  i try to determine what 
went wrong. 

As it is obviously a hardware problem, my question is now: how can i check my 
hardware (disk)?

How can i get informed next time when things are going wrong?

Ok i will come up with a lot of questions as soon as i had another coffee 
because i never want to feel so helpless again. 

There really should be a section in the manual like "desaster recovery" which 
shows some tricks and methods. 

> > pg version is 7.4.2
>
> Download 7.4.5 - that's got the latest bugfixes in it.

i will as soon as my nerves are cooling down again :-)

kind regard,
janning

> --
>Richard Huxton
>Archonet Ltd

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

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


[GENERAL] newby question

2004-10-01 Thread Bernd Buldt
Howdy!   I'd like to set up a database (mostly a bibliography), which 
I'd like to connect to a webpage such that simple queries to the 
database can be made by visitors of my homepage.  I seem to remember 
that FileMaker allows for this, but I'd prefer a UNIX-based solution 
(under MacOS X).  Hence my question (before I start digging):   Can 
anyone on the list confirm that this is doable (w/o too much hassles 
) with PostGresQL?  Thx for your time!  Best,  Bernd

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


Re: [GENERAL] i'm really desperate: invalid memory alloc request

2004-10-01 Thread Richard Huxton
Janning Vygen wrote:
Hi,
tonight my database got corruppted. before it worked fine.
since two days i do the following tasks every night
psql -c 'CLUSTER;' $DBNAME
psql -c 'VACUUM FULL ANALYZE;' $DBNAME
before these opertaions i stop all web access. The last months i only did a 
"VACUUM ANALYZE" each night and didn't get any failures.

in the morning some sql queries failed. it seems only one table was affected.
i stopped all web access and tried to backup the current database:
 >
pg_dump: ERROR:  invalid memory alloc request size 0
pg_dump: SQL command to dump the contents of table "fragentipps" failed: 
PQendcopy() failed.
pg_dump: Error message from server: ERROR:  invalid memory alloc request size 
0
pg_dump: The command was: COPY public.fragentipps (tr_kurzname, mg_name, 
fr_id, aw_antworttext) TO stdout;
Does it do this consistently at the same place?
so i did:
/etc/init.d/postgresql stop
cp -rp /home/postgres/data /home/postgres/datafailure
Good - we know we've got a copy of everything.
and i tried to recover from backup which was made just before clustering but i 
got
ERROR:  index row requires 77768 bytes, maximum size is 8191

is there any chance to get my database keep going again?
There are a few steps - you've already done the first
 1. Stop PG and take a full copy of the data/ directory
 2. Check your installation - make sure you don't have multiple
versions of pg_dump/libraries/etc installed
 3. Try dumping individual tables (pg_dump -t table1 ...)
 4. Reindex/repair files
 5. Check hardware to make sure it doesn't happen again.
Once you've dumped as many individual tables as you can, you can even 
try selecting data to a file avoiding certain rows if they are causing 
the problem.

Then, stop PG and restart a standalone backend. This will let you 
reindex the database, in case a corrupt index is the problem. The 
REINDEX and postgres documentation details this, also check the mailing 
list archives.

There's more you can do after that, but let's see how that works out.
PS - your next mail mentions sig11 which usually implies hardware 
problems, so don't forget to test the machine thoroughly once this is over.

pg version is 7.4.2
Download 7.4.5 - that's got the latest bugfixes in it.
--
  Richard Huxton
  Archonet Ltd
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [GENERAL] i'm really desperate: invalid memory alloc request size 0

2004-10-01 Thread Janning Vygen
Am Freitag, 1. Oktober 2004 09:49 schrieben Sie:
> Hi,
>
> tonight my database got corruppted. before it worked fine.
>
> since two days i do the following tasks every night
>
> psql -c 'CLUSTER;' $DBNAME
> psql -c 'VACUUM FULL ANALYZE;' $DBNAME
>
> before these opertaions i stop all web access. The last months i only did a
> "VACUUM ANALYZE" each night and didn't get any failures.
>
> in the morning some sql queries failed. it seems only one table was
> affected.
>
> i stopped all web access and tried to backup the current database:
>
>
> pg_dump: ERROR:  invalid memory alloc request size 0
> pg_dump: SQL command to dump the contents of table "fragentipps" failed:
> PQendcopy() failed.
> pg_dump: Error message from server: ERROR:  invalid memory alloc request
> size 0
> pg_dump: The command was: COPY public.fragentipps (tr_kurzname, mg_name,
> fr_id, aw_antworttext) TO stdout;
>
> so i did:
> /etc/init.d/postgresql stop
> cp -rp /home/postgres/data /home/postgres/datafailure
>
> and i tried to recover from backup which was made just before clustering
> but i got
> ERROR:  index row requires 77768 bytes, maximum size is 8191
>
> is there any chance to get my database keep going again?
>
> pg version is 7.4.2
>
>
> kind regards
> janning


some additional information from my log files: 

LOG:  server process (PID 24227) was terminated by signal 11
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another ser
ver process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat 
your command.


[...]


LOG:  all server processes terminated; reinitializing
LOG:  database system was interrupted at 2004-10-01 04:59:46 CEST
LOG:  checkpoint record is at 6A/A9142BB4
LOG:  redo record is at 6A/A9016D68; undo record is at 0/0; shutdown FALSE
LOG:  next transaction ID: 202721693; next OID: 352799
LOG:  database system was not properly shut down; automatic recovery in 
progress
LOG:  redo starts at 6A/A9016D68
LOG:  record with zero length at 6A/A931CEE0
LOG:  redo done at 6A/A931CEBC
LOG:  recycled transaction log file "006A00A6"
LOG:  recycled transaction log file "006A00A7"
LOG:  removing transaction log file "006A00A8"
LOG:  database system is ready
LOG:  server process (PID 24235) was terminated by signal 11
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another ser
ver process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat 
your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another ser
ver process exited abnormally and possibly corrupted shared memory.


please help me... 

janning

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


[GENERAL] i'm really desperate: invalid memory alloc request size 0

2004-10-01 Thread Janning Vygen
Hi,

tonight my database got corruppted. before it worked fine.

since two days i do the following tasks every night

psql -c 'CLUSTER;' $DBNAME
psql -c 'VACUUM FULL ANALYZE;' $DBNAME

before these opertaions i stop all web access. The last months i only did a 
"VACUUM ANALYZE" each night and didn't get any failures.

in the morning some sql queries failed. it seems only one table was affected.

i stopped all web access and tried to backup the current database:


pg_dump: ERROR:  invalid memory alloc request size 0
pg_dump: SQL command to dump the contents of table "fragentipps" failed: 
PQendcopy() failed.
pg_dump: Error message from server: ERROR:  invalid memory alloc request size 
0
pg_dump: The command was: COPY public.fragentipps (tr_kurzname, mg_name, 
fr_id, aw_antworttext) TO stdout;

so i did:
/etc/init.d/postgresql stop
cp -rp /home/postgres/data /home/postgres/datafailure

and i tried to recover from backup which was made just before clustering but i 
got
ERROR:  index row requires 77768 bytes, maximum size is 8191

is there any chance to get my database keep going again?

pg version is 7.4.2


kind regards
janning

---(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] Repeated VACUUM reports same number of deleted rows

2004-10-01 Thread Russell Smith
Postgresql 7.4.5

The following VACUUMs were run within a couple of minutes of each other completing.
This table concerned is a table that has not been changed in a long time. (a month)

There were open transactions at the time the vacuum was run. These were created by 
having PHP running with
postgresql.  At least that is what I have managed to find so far. and disabling PHP in 
apache removes them.

postgres  7588  0.0  0.4 50324 3168 ?SSep28   0:00 postgres: postgres 
sqlfilter 10.0.0.5 idle in transaction
postgres  7589  0.0  0.4 50324 3172 ?SSep28   0:00 postgres: postgres 
sqlfilter 10.0.0.5 idle in transaction

Should VACUUM report the rows as deleted or say they could not be deleted?
Why does it report the same information for three runs in a row?

Or is something else going on that I don't understand.

Regards

Russell Smith


sqlfilter=# vacuum verbose filter.access_log_big
sqlfilter-# ;
INFO:  vacuuming "filter.access_log_big"
INFO:  index "access_log_url" now contains 5159204 row versions in 74984 pages
DETAIL:  21455 index pages have been deleted, 2 are currently reusable.
CPU 5.16s/0.69u sec elapsed 650.85 sec.
INFO:  index "access_log_whenwho" now contains 5159204 row versions in 58292 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 5.39s/0.68u sec elapsed 615.43 sec.
INFO:  index "access_log_time" now contains 5159204 row versions in 38063 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 3.34s/0.46u sec elapsed 259.59 sec.
INFO:  index "accesslogbig_domain" now contains 5159204 row versions in 25501 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 2.17s/0.24u sec elapsed 56.53 sec.
INFO:  "access_log_big": found 0 removable, 5159204 nonremovable row versions in 
175418 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 19262 unused item pointers.
0 pages are entirely empty.
CPU 21.06s/2.60u sec elapsed 1662.62 sec.
VACUUM
Time: 1662627.077 ms
sqlfilter=# vacuum verbose filter.access_log_big;
INFO:  vacuuming "filter.access_log_big"
INFO:  index "access_log_url" now contains 5159204 row versions in 74984 pages
DETAIL:  21455 index pages have been deleted, 2 are currently reusable.
CPU 5.57s/0.64u sec elapsed 655.85 sec.
INFO:  index "access_log_whenwho" now contains 5159204 row versions in 58292 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 5.54s/0.52u sec elapsed 589.95 sec.
INFO:  index "access_log_time" now contains 5159204 row versions in 38063 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 3.30s/0.38u sec elapsed 262.43 sec.
INFO:  index "accesslogbig_domain" now contains 5159204 row versions in 25501 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 2.37s/0.20u sec elapsed 54.98 sec.
INFO:  "access_log_big": found 0 removable, 5159204 nonremovable row versions in 
175418 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 19262 unused item pointers.
0 pages are entirely empty.
CPU 21.20s/2.36u sec elapsed 1647.25 sec.
VACUUM
Time: 1647292.681 ms
sqlfilter=# commit;
WARNING:  there is no transaction in progress
COMMIT
Time: 47.537 ms
sqlfilter=# vacuum verbose filter.access_log_big;
INFO:  vacuuming "filter.access_log_big"
INFO:  index "access_log_url" now contains 5159204 row versions in 74984 pages
DETAIL:  21455 index pages have been deleted, 2 are currently reusable.
CPU 4.95s/0.68u sec elapsed 648.90 sec.
INFO:  index "access_log_whenwho" now contains 5159204 row versions in 58292 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 5.29s/0.68u sec elapsed 605.39 sec.
INFO:  index "access_log_time" now contains 5159204 row versions in 38063 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 3.58s/0.42u sec elapsed 250.08 sec.
INFO:  index "accesslogbig_domain" now contains 5159204 row versions in 25501 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 2.13s/0.29u sec elapsed 55.05 sec.
INFO:  "access_log_big": found 0 removable, 5159204 nonremovable row versions in 
175418 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 19262 unused item pointers.
0 pages are entirely empty.
CPU 20.89s/2.58u sec elapsed 1658.31 sec.
VACUUM
Time: 1658431.580 ms

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