Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Chuck D.
On October 25, 2007 09:22:10 pm you wrote:
> Did the sed actually do anything?  (Hint: the file size of
> geonames_fixed.txt would be larger than geonames.txt if it did.
> Or you could diff the two files to confirm that something sensible
> happened.)
>
> I suspect that your shell may be fouling things up here.  You may need
> to prepare this command as a one-line shell script, using an editor that
> doesn't barf on bare carriage returns ...
>
>   regards, tom lane


OK, here's a bit more info after testing the sed on a bash line and in 
a /bin/sh script edited with vi.

One of the troubling rows from the original file looks like this.  This is a 
couple fields, not the whole row.

cat -A short.txt

^IJishishan Bonanzu Dongxiangzu Salarzu Zizhixian^M$
Jishishan Bonanzu Dongxiangzu Salarzu Zizhixian^M$
Jishishan Bonanzu Dongxiangzu Salarzu Zizhixian^M$
^I2007-07-06$

Here's the shell script:

/bin/sed 's/^M/\\r/' < short.txt > short.out

And the result:

^IJishishan Bonanzu Dongxiangzu Salarzu Zizhixian\r$
Jishishan Bonanzu Dongxiangzu Salarzu Zizhixian\r$
Jishishan Bonanzu Dongxiangzu Salarzu Zizhixian\r$
^I2007-07-06$


Of course it sees the \r$ as the end of line and fails with:

ERROR:  missing data for column "full_name"

Does that help diagnose?

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


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Tom Lane
"Chuck D." <[EMAIL PROTECTED]> writes:
> I tried this, which I found on the web from Tom Lane:

> sed 's/^M/\\r/g' geonames.txt > geonames_fixed.txt

> But still get the same error.  I used ctrl-v ctrl-m to reproduce the
> ^M.  Not sure why it is kicking out those lines still.

Did the sed actually do anything?  (Hint: the file size of
geonames_fixed.txt would be larger than geonames.txt if it did.
Or you could diff the two files to confirm that something sensible
happened.)

I suspect that your shell may be fouling things up here.  You may need
to prepare this command as a one-line shell script, using an editor that
doesn't barf on bare carriage returns ...

regards, tom lane

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


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Chuck D.
On October 25, 2007 03:16:59 pm Fernando Hevia wrote:
>
> As I understand it when a line starts with $ you would like to merge it
> with the previous line.
>

No, it appears the data file I am attempting to COPY has some records with 
fields that contain a CR/LF in the data of that field.  Postgres COPY fails 
like this:

ERROR:  literal carriage return found in data
HINT:  Use "\r" to represent carriage return.
CONTEXT:  COPY orig_city_world, line 1071850

I tried this, which I found on the web from Tom Lane:

sed 's/^M/\\r/g' geonames.txt > geonames_fixed.txt

But still get the same error.  I used ctrl-v ctrl-m to reproduce the ^M.  Not 
sure why it is kicking out those lines still.

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


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Fernando Hevia

> On October 25, 2007 10:57:49 am you wrote:
> >
> > If all you just want to do is strip out the ^M, you can run dos2unix on
> > it, assuming that you are running a *nix distro.
> 
> Well, I guess I could strip the ^M but I'm still left with a $ in the
> middle
> of a field which in the same as the line terminator, so COPY thinks it is
> at
> the end of a line when it is really in the middle of the field.  I really
> wish they would have quoted these fields, but I'm at a loss how to import
> these.
> 

As I understand it when a line starts with $ you would like to merge it with
the previous line.

I suppose you have a file like this:

--- test.txt ---
this is 
$field1, and this is 
$field2

I'll create the test file:

$ printf "this is \n\$field1, and this is \n\$field2\n" > test.txt

(I assume ^M have already been replaced so \n are used instead)

A short C program should do it:

/*-- code listing -*/
#include 
#include 

#define NL '\n'
#define FILTER '$'

int main(int argc, char *argv[]) {
FILE *fp;
char c;

if (argc < 2) fp=stdin;
else {
fp=fopen(argv[1], "r");
if (!fp) {
perror(argv[1]);
exit(1);
}
}

c=fgetc(fp);
while(!feof(fp)) {
if(c==NL) {
c=fgetc(fp);
if(feof(fp)) {
putchar(NL);
break;
}
}
if(c!=FILTER) putchar(c);
c=fgetc(fp);
}
exit (0);
}
/*--*/

compile as:
$ gcc -o test test.c

Execute as:
$ test test.txt
this is  field1, and this is field2


Could this be of help?

Regards,
Fernando.


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


[SQL] hidden versioning system

2007-10-25 Thread Darnell Brawner

I am trying to make a sql based versioning system.
I am working on a Ruby on Rails project and am using a plugin called  
hobo the plugin can do some nice things but over all its lame but  
thats what i got  to work with.
The problem is hobo does a lot of work for you but the database most  
be in a standard format to use it.

so my idea for a sql versioning  work around was this.

CREATE TABLE main(
id serial CONSTRAINT firstkey PRIMARY KEY,
parent_id int,
title varchar(30),
public boolean default false
);

INSERT INTO main(parent_id,title,public)
VALUES
(1,'blah',true),
(1,'tah',false),
(1,'blah2',false),
(1,'blah3',false),
(2,'tah2',false),
(2,'tah3',true);

CREATE VIEW  vmain as
(SELECT * FROM main
   WHERE public=true
   ORDER BY id DESC)
   UNION
(SELECT *
   FROM main
   WHERE id IN (select max(id) from main group by parent_id)
   ORDER BY id DESC)

CREATE OR REPLACE RULE main_up AS ON UPDATE TO vmain
DO INSTEAD
INSERT INTO main(parent_id,title,public)
VALUES(NEW.parent_id,NEW.title,false);

the result of the view should be all rows with public as true and one  
false for each new parent_id  if any that must have a higher id than  
the true one.


So on the web server, someone of level writer can edit something a  
superuser has created but what happens is it puts the update into the  
view hits the rule and makes a dup in the main table with public set  
to false so no one on the outside can see it. And basically the most  
rows that show up will be the public on and the highest id private  
one i don't really care about them rolling back versions.


My problem is when the admin wants to approve the private row.  I tryed
CREATE OR REPLACE RULE main_up AS ON UPDATE TO vmain
DO INSTEAD
CASE NEW.public = true and OLD.public = false
THEN
UPDATE main set public=true where id=NEW.id
ELSE
INSERT INTO main(parent_id,title,public)
VALUES(NEW.parent_id,NEW.title,false);

But i can't seem to put CASE statements in a rule is there any why i  
can do then with out having to create a function and rule that fires it?

This has to  go on alot of table.


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

  http://archives.postgresql.org


Re: [SQL] JOINing based on whether an IP address is contained within a CIDR range?

2007-10-25 Thread Tom Lane
"Jamie Tufnell" <[EMAIL PROTECTED]> writes:
> Is it possible to somehow JOIN using the <<= and
> = network operators?

Sure, why not?

You probably won't get a plan that's smarter than a nestloop, but I
imagine you'll have few enough rows in network_names that it won't
matter.

One potential problem is if there could be overlapping entries in
network_names --- the join would give you multiple rows for any
log entry that matches more than one network_names entry.  You
could fix that using a subselect with LIMIT 1, as long as you
weren't too picky about which name got reported.

regards, tom lane

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

   http://archives.postgresql.org


Re: [SQL] JOINing based on whether an IP address is contained within a CIDR range?

2007-10-25 Thread Erik Jones


On Oct 25, 2007, at 1:22 PM, Jamie Tufnell wrote:


Hi,

I am storing a log of HTTP requests in a database table (including  
IP address):


http_log: id(PK), path, time, ip

I have another table that contains CIDR ranges and names for them:

network_names: id(PK), cidr, name

Some example data for both tables:

network_names:
1, 192.168.0.0/24, 'Engineering'
2, 192.168.1.0/24, 'Media'
3, 192.168.2.0/24, 'Engineering'
4, 192.168.3.0/24, 'Accounting'
5, 192.168.4.0/24, 'Engineering'
6, 10.0.0.0/8, 'Engineering'

http_log:
1, '/index.html', 11001, 192.168.0.47/32
2, '/index.html', 11023, 200.1.2.3/32
3, '/index.html', 11059, 1.2.3.4/32
4, '/index.html', 11232, 192.168.2.1/32
5, '/index.html', 113919102, 192.168.1.39/32
6, '/index.html', 129101293, 10.2.2.4/32
7, '/index.html', 132828282, 192.168.4.2/32

Now, in trying to produce a report on this data, I've come up  
against an interesting (to me at least!) problem..


I basically want the same output as in http_log, but substituting  
the IP with the network name where available, i.e:


1, '/index.html', 11001, Engineering
2, '/index.html', 11023, 200.1.2.3/32
3, '/index.html', 11059, 1.2.3.4/32
4, '/index.html', 11232, Engineering
5, '/index.html', 113919102, Media
6, '/index.html', 129101293, Engineering
7, '/index.html', 132828282, Engineering

I'm wondering what the best way of doing this is (considering that  
http_log could have >10 rows)  Is it possible to somehow JOIN  
using the <<= and >>= network operators?  Or would I have to  
iterate the network_names table manually with LOOP (or something)  
on every row of the http_log?


If anyone can share some advice, that would be great!


Check out: http://www.postgresql.org/docs/8.2/interactive/functions- 
net.html


Erik Jones

Software Developer | Emma®
[EMAIL PROTECTED]
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com



---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Chuck D.
On October 25, 2007 10:57:49 am you wrote:
>
> If all you just want to do is strip out the ^M, you can run dos2unix on
> it, assuming that you are running a *nix distro.

Well, I guess I could strip the ^M but I'm still left with a $ in the middle 
of a field which in the same as the line terminator, so COPY thinks it is at 
the end of a line when it is really in the middle of the field.  I really 
wish they would have quoted these fields, but I'm at a loss how to import 
these.

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


[SQL] JOINing based on whether an IP address is contained within a CIDR range?

2007-10-25 Thread Jamie Tufnell
Hi,

I am storing a log of HTTP requests in a database table (including IP
address):

http_log: id(PK), path, time, ip

I have another table that contains CIDR ranges and names for them:

network_names: id(PK), cidr, name

Some example data for both tables:

network_names:
1, 192.168.0.0/24, 'Engineering'
2, 192.168.1.0/24, 'Media'
3, 192.168.2.0/24, 'Engineering'
4, 192.168.3.0/24, 'Accounting'
5, 192.168.4.0/24, 'Engineering'
6, 10.0.0.0/8, 'Engineering'

http_log:
1, '/index.html', 11001, 192.168.0.47/32
2, '/index.html', 11023, 200.1.2.3/32
3, '/index.html', 11059, 1.2.3.4/32
4, '/index.html', 11232, 192.168.2.1/32
5, '/index.html', 113919102, 192.168.1.39/32
6, '/index.html', 129101293, 10.2.2.4/32
7, '/index.html', 132828282, 192.168.4.2/32

Now, in trying to produce a report on this data, I've come up against an
interesting (to me at least!) problem..

I basically want the same output as in http_log, but substituting the IP
with the network name where available, i.e:

1, '/index.html', 11001, Engineering
2, '/index.html', 11023, 200.1.2.3/32
3, '/index.html', 11059, 1.2.3.4/32
4, '/index.html', 11232, Engineering
5, '/index.html', 113919102, Media
6, '/index.html', 129101293, Engineering
7, '/index.html', 132828282, Engineering

I'm wondering what the best way of doing this is (considering that http_log
could have >10 rows)  Is it possible to somehow JOIN using the <<= and
>>= network operators?  Or would I have to iterate the network_names table
manually with LOOP (or something) on every row of the http_log?

If anyone can share some advice, that would be great!

Thanks,
JST


Re: [SQL] (repost) Help understanding expressions in order by clause

2007-10-25 Thread Tom Lane
Steve Midgley <[EMAIL PROTECTED]> writes:
> select * from test_order
> order by id <> 3, email
> --sql end

> Putting the expression "id <> 3" causes the id of 3 to sort to the TOP 
> of the list. This statement does the same thing:

> select * from test_order
> order by id = 3 DESC, email

> I know there is a good, rational reason for this, and I'm hoping 
> someone will explain it to me?

These expressions yield boolean true or false, and false sorts before true.

regards, tom lane

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


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Bricklen Anderson

Chuck D. wrote:

Pardon me on this, the cat -A report for the failed line (and subsequent 
lines) shows ^M$ within the field, not just $.


I assume that is probably a \r\n and postgres wants \r for field data and \n 
to end a line.


I've tried working this over with sed but can't get the syntax right.  I also 
have iconv installed if that would help any.  Are there any good tools that 
will tell me what this really is instead of just ^M$ ?


If all you just want to do is strip out the ^M, you can run dos2unix on 
it, assuming that you are running a *nix distro.


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

  http://www.postgresql.org/docs/faq


[SQL] (repost) Help understanding expressions in order by clause

2007-10-25 Thread Steve Midgley

Hi,

(I posted this to the list on 10/25 but it didn't seem to get 
distributed - apologies if it did and I'm actually double posting right 
now..)


I've read on this list about some pretty powerful examples of using 
expressions in order by clauses to sort according to very complex 
rules. I kind of half "get it" and was playing around with it today to 
learn more. I'm hoping for one or two additional pointers from the 
resident experts..


Take this sample:

--sql start
drop table if exists test_order;
create temp table test_order
(
 id serial,
 email varchar(255)
);
insert into test_order (email)
values ('[EMAIL PROTECTED]');
insert into test_order (email)
values ('[EMAIL PROTECTED]');
insert into test_order (email)
values ('[EMAIL PROTECTED]');
insert into test_order (email)
values ('[EMAIL PROTECTED]');
insert into test_order (email)
values ('[EMAIL PROTECTED]');

select * from test_order
order by id <> 3, email
--sql end

Putting the expression "id <> 3" causes the id of 3 to sort to the TOP 
of the list. This statement does the same thing:


select * from test_order
order by id = 3 DESC, email

I know there is a good, rational reason for this, and I'm hoping 
someone will explain it to me? From what I can see, true is sorting 
AFTER false in Postgres? In general, is it better/preferred just to use 
"case" statements to get the results I'm expecting?


Or maybe someone could point me to the relevant docs that explains 
order by behavior in more detail? I read this 
http://www.postgresql.org/docs/8.2/interactive/sql-select.html#SQL-ORDERBY 
and it didn't make things any clearer.


I'm quite interested in the power of "expressioned sort by's" and so I 
appreciate any assistance in this regard.


Thanks!

Steve


---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Chuck D.
On October 25, 2007 09:35:23 am Chuck D. wrote:
> On October 24, 2007 01:10:59 am Paul Lambert wrote:
> > I get around this problem with my data loads by specifying some other
> > arbitrary character that I know won't appear in the data as the quote
> > character.
> >
> > Eg QUOTE E'\f' will specify form feed as the quote character, ergo any
> > data with double or single quotes will be loaded with those quote
> > characters in the string.
> >
> > Something similar may help with your case.
>
> This was the solution.  I specified a quote character that was not in the
> data and the data imported perfectly.  Without specifying any delimiter
> postgres defaults to one of the quotes (I forget which).
>
> Unfortunately, the data I imported wasn't good.  MaxMind, like the
> Geonames.org derivatives, uses FIPS code for a state identifier in the
> cities table for all countries EXCEPT USA in which case they use the iso
> code.  Both these data sets mix types within one column and I find that
> absolutely unacceptable.
>
> Back to my original problem, which was trying to COPY in some of the
> earth-info.nga.mil world city data.  This data is tab delimited, no quotes
> around fields, newline line terminated and UTF-8 encoded.
>
> Using a similar COPY statement with the defaults, it fails with this:
>
> COPY geo.orig_city FROM
> '/home/www/geo/DATA/nga.mil/geonames_no_header.txt';
>
> ERROR:  literal carriage return found in data
> HINT:  Use "\r" to represent carriage return.
> CONTEXT:  COPY orig_city, line 1071850
>
> And of course, at that line we find a field that has several lines which
> appear (using cat -A) to be terminated with a new line ($).  I originally
> deleted this line but there are others like it.  And the file is 2 Gigs in
> size so it isn't acceptable to comb through it.
>
> I believe this is a new problem because I have a vintage file dated early
> 2007 that didn't have this problem.  Does anyone know how to solve this
> COPY issue?
>


Pardon me on this, the cat -A report for the failed line (and subsequent 
lines) shows ^M$ within the field, not just $.

I assume that is probably a \r\n and postgres wants \r for field data and \n 
to end a line.

I've tried working this over with sed but can't get the syntax right.  I also 
have iconv installed if that would help any.  Are there any good tools that 
will tell me what this really is instead of just ^M$ ?

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


Re: [SQL] request for help with COPY syntax

2007-10-25 Thread Chuck D.
On October 24, 2007 01:10:59 am Paul Lambert wrote:
>
> I get around this problem with my data loads by specifying some other
> arbitrary character that I know won't appear in the data as the quote
> character.
>
> Eg QUOTE E'\f' will specify form feed as the quote character, ergo any
> data with double or single quotes will be loaded with those quote
> characters in the string.
>
> Something similar may help with your case.

This was the solution.  I specified a quote character that was not in the data 
and the data imported perfectly.  Without specifying any delimiter postgres 
defaults to one of the quotes (I forget which).

Unfortunately, the data I imported wasn't good.  MaxMind, like the 
Geonames.org derivatives, uses FIPS code for a state identifier in the cities 
table for all countries EXCEPT USA in which case they use the iso code.  Both 
these data sets mix types within one column and I find that absolutely 
unacceptable.

Back to my original problem, which was trying to COPY in some of the 
earth-info.nga.mil world city data.  This data is tab delimited, no quotes 
around fields, newline line terminated and UTF-8 encoded.

Using a similar COPY statement with the defaults, it fails with this:

COPY geo.orig_city FROM '/home/www/geo/DATA/nga.mil/geonames_no_header.txt';

ERROR:  literal carriage return found in data
HINT:  Use "\r" to represent carriage return.
CONTEXT:  COPY orig_city, line 1071850

And of course, at that line we find a field that has several lines which 
appear (using cat -A) to be terminated with a new line ($).  I originally 
deleted this line but there are others like it.  And the file is 2 Gigs in 
size so it isn't acceptable to comb through it.

I believe this is a new problem because I have a vintage file dated early 2007 
that didn't have this problem.  Does anyone know how to solve this COPY 
issue?


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

   http://www.postgresql.org/docs/faq


Re: [SQL] get only rows for latest version of contents

2007-10-25 Thread Erik Jones


On Oct 25, 2007, at 1:50 AM, Sébastien Meudec wrote:


Thx a lot Chris.

In fact the correct SQL was (rewritten with inner join because of  
it is

required by my api):

select b1.*
from business b1
inner join (select idnode,max(version_no) as version_no from business
group by idnode) as b2
on b1.idnode = b2.idnode and
  (b1.version_no = b2.version_no or b2.version_no is null)

Regards,
Seb.



-Message d'origine-
De : [EMAIL PROTECTED] [mailto:pgsql-sql-
[EMAIL PROTECTED] De la part de Christian Kindler
Envoyé : mercredi 24 octobre 2007 11:55
À : Sébastien Meudec
Cc : pgsql-sql@postgresql.org
Objet : Re: [SQL] get only rows for latest version of contents

Hi!

not quick mut works

select * from business b1
where b1.version_no = (SELECT max(version_no) FROM business b2.
where b2.idnode = b1.idnode
   )

If you want to make this quiry faster du a regular join

select b1.*
  from business b1,
   (SELECT max(version_no) FROM business b2.
 where b2.idnode = b1.idnode
   ) as b2
where b1.idnode = b2.idnode
  and b1.version_no = b2.version_nr

Regards Chris

PS written without running any sql, maybe there are some syntax  
issues,

but i am shure you will figure these out :-)



On Wed, October 24, 2007 11:29 am, Sébastien Meudec wrote:

Hi everybody.

I have a table like that (i simplified it):
CREATE TABLE business {
  idnode integer not null,
  version_no integer,
  c1 text,
  c2 text,
  c3 text
}
With a unique index in (idnode,version_no).

This table records many version from contents identified by  
idnode where

texts may be different.
So i can have:
Idnode | version_no | c1| c2| c3
111| 2  | foo1  | foo2  | foo3
111| 1  | fee1  | foo2  | foo3
111| null   | fee1  | fee2  | fee3
222| null   | too1  | too2  | too3
333| 1  | xoo1  | xoo2  | xoo3
333| null   | yoo1  | yoo2  | yee3

I want to select all columns but only for last (greatest) version of

each

content. So I want a result like:
Idnode | version_no | c1| c2| c3
111| 2  | foo1  | foo2  | foo3
222| null   | too1  | too2  | too3
333| 1  | xoo1  | xoo2  | xoo3

If i do:
SELECT idnode, max(version_no) FROM business
GROUP BY idnode ORDER BY idnode;

I get effectively only last version:
Idnode | version_no
111| 2
222| null
333| 1

But as soon that i want to get texts, I don't know how to build  
the SQL.
In each SQL i tested i've been forced to put text column in a  
group by

since
i used aggregate for version_no:
SELECT idnode, max(version_no), c1, c2, c3 FROM BUSINESS
GROUP BY idnode, c1, c2, c3 ORDER BY idnode;

But with that SQL, because of the group by and different values  
in text

i

get
Idnode | version_no | c1| c2| c3
111| 2  | foo1  | foo2  | foo3
111| 1  | fee1  | foo2  | foo3
111| null   | fee1  | fee2  | fee3
222| null   | too1  | too2  | too3
333| 1  | xoo1  | xoo2  | xoo3
333| null   | yoo1  | yoo2  | yee3

As we can't do aggregate in join neither in where, i can't get  
what i

want.

Anybody could help me to build proper SQL ?

Thx for your answers.
Sébastien.


Here's another little trick that can come in handy for this:

SELECT DISTINCT ON (Idnode) Idnode, version_no, c1, c2, c3
FROM business
ORDER BY Idnode, version_no DESC;

Erik Jones

Software Developer | Emma®
[EMAIL PROTECTED]
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com



---(end of broadcast)---
TIP 1: 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: [SQL] ERROR: failed to re-find parent key in "pk_ep07"

2007-10-25 Thread Filip Rembiałkowski
2007/10/25, Otniel Michael <[EMAIL PROTECTED]>:
> OC. I will try to upgrade the postgres. What version that can fix this
> problem? Postgres 8.2.5? Postgres 8.1?
>
> Now, i use postgres 8.0.3, what effect when i upgrade the postgres version?
> I heared that i should check my sql? In postgres 8.0.3 show as warning, in
> postgres 8.1 as error?
>

If you can afford some testing time, try with the very latest stable
version (8.2.5 at the moment).

If you can't, just take the last patchlevel from 8.0.x series  - the
upgrade is seamless
(just backup - stop the server - replace binaries - start servar )

Detrailed upgrade procedures are described either in manual or
somewhere on the net.


cheers

-- 
Filip Rembiałkowski

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


Re: [SQL] ERROR: failed to re-find parent key in "pk_ep07"

2007-10-25 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes:

> Otniel Michael <[EMAIL PROTECTED]> writes:
>> When i was vacuum the database, the vacuum if failed. And I get this error. 
>> Any ideas an to fix this?
>>ERROR:  failed to re-find parent key in "pk_ep07"
>
> Update to a newer PG version, possibly?  This symptom has been seen
> before...

It was fixed in these bug-fix releases: 7.4.15, 8.0.10, and 8.1.6 which were
released on August 1st of this year. There have actually been 3 to 4 more
bug-fix releases since those too.

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com

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

   http://archives.postgresql.org


Re: [SQL] ERROR: failed to re-find parent key in "pk_ep07"

2007-10-25 Thread Otniel Michael


Note: forwarded message attached.

-- 
 "He who is quick to become angry will commit folly, and a crafty man is hated" 
 

 __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com --- Begin Message ---
OC. I will try to upgrade the postgres. What version that can fix this problem? 
Postgres 8.2.5? Postgres 8.1?

Now, i use postgres 8.0.3, what effect when i upgrade the postgres version?
I heared that i should check my sql? In postgres 8.0.3 show as warning, in 
postgres 8.1 as error?

Thanks.

Tom Lane <[EMAIL PROTECTED]> wrote: Otniel Michael  writes:
> When i was vacuum the database, the vacuum if failed. And I get this error. 
> Any ideas an to fix this?
>ERROR:  failed to re-find parent key in "pk_ep07"

Update to a newer PG version, possibly?  This symptom has been seen
before...

   regards, tom lane



-- 
 "He who is quick to become angry will commit folly, and a crafty man is hated" 
 

 __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com --- End Message ---

---(end of broadcast)---
TIP 1: 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