CRC was: Re: [HACKERS] beta testing version

2000-12-06 Thread Horst Herb
> This may be implemented very fast (if someone points me where > I can find CRC func). And I could implement "physical log" > till next monday. I have been experimenting with CRCs for the past 6 month in our database for internal logging purposes. Downloaded a lot of hash libraries, tried differ

[HACKERS] Re: A mb problem in PostgreSQL

2000-12-06 Thread Tatsuo Ishii
Chih-Chang, > Do you remember the mb problem about Big5? Sure. > Now I have tested all Big5 chars (with ETen extension -- some chars in > CNS 11643-1992 Plane 3) by the program in the attachment on > PostgreSQL 7.0.3 with patches from you show me. > The execution result is also in the attachmen

Re: [HACKERS] HeapTuple?

2000-12-06 Thread Tom Lane
mlw <[EMAIL PROTECTED]> writes: > I should be able to do either: > create table fubar as select bunch_o_tuples('bla bla'); You might think that, but you can't. The support for functions returning tuple sets that you are looking for just plain ain't there. Maybe in 7.2... It is possible to retu

Re: [HACKERS] beta testing version

2000-12-06 Thread Tom Lane
> Lifted from the PNG spec (RFC 2083): Drat, I dropped the table declarations: /* Table of CRCs of all 8-bit messages. */ unsigned long crc_table[256]; /* Flag: has the table been computed? Initially false. */ int crc_table_computed = 0; regards

Re: [HACKERS] beta testing version

2000-12-06 Thread Tom Lane
"Mikheev, Vadim" <[EMAIL PROTECTED]> writes: > This may be implemented very fast (if someone points me where > I can find CRC func). Lifted from the PNG spec (RFC 2083): 15. Appendix: Sample CRC Code The following sample code represents a practical implementation of the CRC (Cyclic Redun

RE: [HACKERS] beta testing version

2000-12-06 Thread Mikheev, Vadim
> > > > Sounds great! We can follow this way: when first after last > > > > checkpoint update to a page being logged, XLOG code can log > > > > not AM specific update record but entire page (creating backup > > > > "physical log"). During after crash recovery such pages will > > > > be redone fir

[HACKERS] HeapTuple?

2000-12-06 Thread mlw
Could someone explain this to me? (This is my second attempt at asking this) create function bunch_o_tuples (varchar) returns opaque as '/local/projects/phoenix/pg/pgtpl.so', 'tuple' language 'c'; I should be able to do either: create table fubar as select bunch_o_tuples('bla

RE: AW: [HACKERS] beta testing version

2000-12-06 Thread Christopher Kings-Lynne
> CRCs are designed to catch N-bit errors (ie N bits in a row with their > values flipped). N is (IIRC) the number of bits in the CRC minus one. > So, a 32-bit CRC can catch all 31-bit errors. That's the only guarantee > a CRC gives. Everything else has a 1 in 2^32-1 chance of producing the >

Re: [HACKERS] CRCs (was: beta testing version)

2000-12-06 Thread Bruce Guenter
On Wed, Dec 06, 2000 at 11:08:00AM -0800, Nathan Myers wrote: > On Wed, Dec 06, 2000 at 11:49:10AM -0600, Bruce Guenter wrote: > > On Wed, Dec 06, 2000 at 11:15:26AM -0500, Tom Lane wrote: > > > How exactly *do* we determine where the end of the valid log data is, > > > anyway? > > > > I don't kn

Re: AW: [HACKERS] beta testing version

2000-12-06 Thread Bruce Guenter
On Wed, Dec 06, 2000 at 11:13:33PM +, Daniele Orlandi wrote: > Bruce Guenter wrote: > > - Assume that a CRC is a guarantee. A CRC would be a good addition to > > help ensure the data wasn't broken by flakey drive firmware, but > > doesn't guarantee consistency. > Even a CRC per transactio

Re: [HACKERS] RFC C++ Interface

2000-12-06 Thread Nathan Myers
On Wed, Dec 06, 2000 at 05:09:31PM -0500, Randy Jonasz wrote: > > I know it's been a while since we last discussed a possible rewrite of > the C++ API but I now have some time to devote to it. > > The following are my ideas for implementing the C++ API: > > I need suggestions, additions, commen

Re: [HACKERS] Re: COPY BINARY file format proposal

2000-12-06 Thread Philip Warner
At 15:36 6/12/00 -0500, Tom Lane wrote: >Grumble, I forgot about COPY WITH OIDS. Amend that proposal as follows: > >... We should use two different >magic numbers depending on whether OIDs are included in the dump or not. I'd prefer to see a single magic number for all binary COPY output, then a

Re: [HACKERS] Re: COPY BINARY file format proposal

2000-12-06 Thread Philip Warner
At 21:12 6/12/00 -0500, Tom Lane wrote: >Philip Warner <[EMAIL PROTECTED]> writes: >>> OK, we can do it that way. I'm still going to pick a magic number that >>> looks different depending on endianness, however ;-). > >> What does the smiley mean in this context? > >Just thinking that the only wa

Re: [HACKERS] Re: COPY BINARY file format proposal

2000-12-06 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: >> OK, we can do it that way. I'm still going to pick a magic number that >> looks different depending on endianness, however ;-). > What does the smiley mean in this context? Just thinking that the only way an endianness flag inside the header would be

Re: [HACKERS] Re: COPY BINARY file format proposal

2000-12-06 Thread Philip Warner
At 20:40 6/12/00 -0500, Tom Lane wrote: >Philip Warner <[EMAIL PROTECTED]> writes: >> I'd prefer to see a single magic number for all binary COPY output, then a >> few bytes of header including a version number, and flags to indicate >> endianness, OIDs etc. It seems a lot cleaner than overloading

Re: [HACKERS] Re: COPY BINARY file format proposal

2000-12-06 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > I'd prefer to see a single magic number for all binary COPY output, then a > few bytes of header including a version number, and flags to indicate > endianness, OIDs etc. It seems a lot cleaner than overloading the magic > number. OK, we can do it that

Re: [HACKERS] CVS: miscadmin.h is missing

2000-12-06 Thread Oleg Bartunov
On Wed, 6 Dec 2000, Tom Lane wrote: > Date: Wed, 06 Dec 2000 12:20:28 -0500 > From: Tom Lane <[EMAIL PROTECTED]> > To: Oleg Bartunov <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [HACKERS] CVS: miscadmin.h is missing > > Oleg Bartunov <[EMAIL PROTECTED]> writes: > > utils/elog.h re

Re: AW: [HACKERS] beta testing version

2000-12-06 Thread Daniele Orlandi
Bruce Guenter wrote: > > - Assume that a CRC is a guarantee. A CRC would be a good addition to > help ensure the data wasn't broken by flakey drive firmware, but > doesn't guarantee consistency. Even a CRC per transaction (it could be a nice END record) ? Bye! -- Daniele --

Re: [HACKERS] Logging for sequences

2000-12-06 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > At 17:39 29/11/00 -0800, Mikheev, Vadim wrote: >> BTW, why SETVAL is called in pg_dump output instead of >> if (called) NEXTVAL? SETVAL is disallowed for sequences >> with cache_value > 1 - ie we can't dump such sequences now. > Can someone explain this

[HACKERS] Re: COPY BINARY file format proposal

2000-12-06 Thread Tom Lane
Grumble, I forgot about COPY WITH OIDS. Amend that proposal as follows: ... We should use two different magic numbers depending on whether OIDs are included in the dump or not. If OIDs are included in the dump, the OID field immediately follows the field-count word. It is a normal field except

[HACKERS] RFC C++ Interface

2000-12-06 Thread Randy Jonasz
I know it's been a while since we last discussed a possible rewrite of the C++ API but I now have some time to devote to it. The following are my ideas for implementing the C++ API: I need suggestions, additions, comments etc! All classes will be defined in postgres namespace. The desired usa

[HACKERS] CRCs (was: beta testing version)

2000-12-06 Thread Nathan Myers
On Wed, Dec 06, 2000 at 11:49:10AM -0600, Bruce Guenter wrote: > On Wed, Dec 06, 2000 at 11:15:26AM -0500, Tom Lane wrote: > > Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > > > Yes, but there would need to be a way to verify the last page or > > > record from txlog when running on crap hard

[HACKERS] COPY BINARY file format proposal

2000-12-06 Thread Tom Lane
Well, no one seemed very unhappy at the idea of changing the file format for binary COPY, so here is a proposal. The objectives of this change are: 1. Get rid of the tuple count at the front of the file. This requires an extra pass over the relation, which is a lot more trouble than the count i

RE: [HACKERS] Logging for sequences

2000-12-06 Thread Mikheev, Vadim
> Vadim, Philip changed that part of pg_dump on my advice. The idea was > to try to do the right thing for sequences when loading schema only or > data only. Analogously to loading data into a pre-existing table, we > felt that a data dump ought to be able to restore the current state of > an al

[HACKERS] CRCs (was: beta testing version)

2000-12-06 Thread Nathan Myers
On Wed, Dec 06, 2000 at 12:29:00PM +0100, Zeugswetter Andreas SB wrote: > > > Why should we do this? I'm not going to replay parts individually, > > I'm going to write entire pages to OS cache and than apply changes > > to them. Recovery is considered as succeeded after server is ensured > > that

Re: AW: [HACKERS] beta testing version

2000-12-06 Thread Bruce Guenter
On Wed, Dec 06, 2000 at 11:15:26AM -0500, Tom Lane wrote: > Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > > Yes, but there would need to be a way to verify the last page or > > record from txlog when running on crap hardware. > How exactly *do* we determine where the end of the valid log da

Re: [HACKERS] CVS: miscadmin.h is missing

2000-12-06 Thread Tom Lane
Oleg Bartunov <[EMAIL PROTECTED]> writes: > utils/elog.h requires miscadmin.h which is doesn't installed. We've never installed miscadmin.h. I think it's a mistake to have elog.h include it ... will change. regards, tom lane

Re: AW: [HACKERS] beta testing version

2000-12-06 Thread Daniele Orlandi
Tom Lane wrote: > > Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > > Yes, but there would need to be a way to verify the last page or > > record from txlog when running on crap hardware. > > How exactly *do* we determine where the end of the valid log data is, > anyway? Couldn't you use a

[HACKERS] CVS: miscadmin.h is missing

2000-12-06 Thread Oleg Bartunov
In current CVS utils/elog.h requires miscadmin.h which is doesn't installed. Regards, Oleg _ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Int

Re: AW: [HACKERS] beta testing version

2000-12-06 Thread Tom Lane
Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > Yes, but there would need to be a way to verify the last page or > record from txlog when running on crap hardware. How exactly *do* we determine where the end of the valid log data is, anyway? regards, tom lane

Re: [HACKERS] CAST ON NEW TYPE

2000-12-06 Thread Thomas Lockhart
> I create a new type that work well, but when > i use the cast function on my new type like this i have an error: > (other fucntion like substring don't work too ) > select bare_code::text from ean_article; > ERROR: Cannot cast type 'ean13' to 'text' > What can i do in my new type in order to us

Re: [HACKERS] CAST ON NEW TYPE

2000-12-06 Thread Tom Lane
<[EMAIL PROTECTED]> writes: > select bare_code::text from ean_article; > ERROR: Cannot cast type 'ean13' to 'text' > What can i do in my new type in order to use cast ??? You have to provide a conversion function, declared like text(ean13) returns text The cast syntax is just an alias

Re: [HACKERS] Foreign key references to non-primary key columns

2000-12-06 Thread Camm Maguire
Greetings, and thanks so much for your reply! Stephan Szabo <[EMAIL PROTECTED]> writes: > On 5 Dec 2000, Camm Maguire wrote: > > > Greetings! I've noticed in the documentation that the sql standard > > requires foreign keys to reference primary key/(or maybe just unique) > > columns, but tha

[HACKERS] CAST ON NEW TYPE

2000-12-06 Thread pejac
Hi, I create a new type that work well, but when i use the cast function on my new type like this i have an error: (other fucntion like substring don't work too ) select bare_code::text from ean_article; ERROR: Cannot cast type 'ean13' to 'text' What can i do in my new type in order to use cas

[HACKERS] BLOB Help!

2000-12-06 Thread Felix Lungu
I trying to implement a custom datatype and after I have read the docs I understand that I should use large objects is the data type is to bigger than 8K. I have one question about using BLOBs in my intended work: -is there a way to automate the the creation of new object when a new row is insert

AW: [HACKERS] beta testing version

2000-12-06 Thread Zeugswetter Andreas SB
> > > Sounds great! We can follow this way: when first after last > > > checkpoint update to a page being logged, XLOG code can log > > > not AM specific update record but entire page (creating backup > > > "physical log"). During after crash recovery such pages will > > > be redone first, ensur

RE: [HACKERS] Indexing for geographic objects?

2000-12-06 Thread Edmar Wiggers
> Do you have a reference, or more information on what a Peano code is? Check this out http://www.statkart.no/nlhdb/iveher/hhtext.htm Shortly, this technique relies on a space filling curve. That is, a uni-dimensional curve that, on a given plane, covers every single point, and only covers it on

[HACKERS] Function returning tuples.

2000-12-06 Thread mlw
For an extension I am writing, I want to be able to write a function that does this: select * from table where field = textsearch(field, 'la bla bla', 10) order by score(10); I can currently do this: create temp table search_results (key int, rank int); select plpgsql_textsearch(); selec

Re: [HACKERS] How to reset WAL enveironment

2000-12-06 Thread Hiroshi Inoue
Mikheev, Vadim wrote: > > > > > FATAL 2: btree_insert_redo: uninitialized page > > > > > > > > Is it a bug ? > > > > > > Seems so. btree_insert_redo shouldn't see uninitialized pages > > > (only newroot and split ops add pages to index and they should > > > be redone before insert op). > > > Can