[HACKERS] # of tuples on a Table?

2006-11-16 Thread luis garcia

Hi I've been making some changes to Postgres insertion method (InsertStmt)
and I'm trying to find out how much tuples are stored in one specific table
before the insertion of the next tuple, because of that will depend the
exact
insertion method that I will use...

I just really wanna know if there's a implemented sequence for doing that?

Thanks...
--
Luis D. García M.
Telf: 0414-3482018

- FACYT - UC -
- Computación -


[HACKERS] ¿¿¿past chunk end???

2006-11-01 Thread luis garcia
Hi We have been making some modifications to postgres catalog, butit seems to be a problem with one of the fields we just added, exactlyin the time when inserting the right values to that specific field.
1. This is what It happens:**template1=# CREATE TABLE test() AS VALID EVENT 2 WITH FREQUENCY '00:00:50.00' AS REAL TIME;WARNING: detected write past chunk end in CacheMemoryContext 0xb7212e0c
CREATE TABLE**The creation it's possible, in fact, We have added 7 fields to Postgrescatalog (in pg_class) and there are no problems with the other fields values,
just with this one.2. The field is defined this way:

// FILE: Parsenodes.h

// STRUCTURE: frequencyDefinition

typedef struct FrequencyDefinition
{
 NodeTag  type;
 bool  timeFrequency;
 FrequencyType fttype;
 const char *frequencyMeasure; // THIS ONE
} FrequencyDefinition;
3. The values are inserted this way:// FILE: relcache.c// FUNCTION: RelationBuildLocalRelation**rel-rd_rel-relhasfrequency = freqDef-timeFrequency; // Perfect Asignation
if((freqDef-fttype) == REAL_TIME)   namestrcpy(rel-rd_rel-relfrequencytype,(const char *)REAL TIME);  else   namestrcpy(rel-rd_rel-relfrequencytype,(const char *)HISTORIC);
namestrcpy(rel-rd_rel-relfrequency,freqDef-frequencyMeasure)**We can see the other values whit a SELECT over PG_CLASS:template1=# SELECT relname, relhasfrequency, relfrequencytype, relfrequency FROM pg_class WHERE relhasfrequency=true;
relname | relhasfrequency | relfrequencytype | relfrequency- - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - -test | t | REAL TIME | 0
(1 row)We have realized that in the assignation it takes just the first CHAR from '00:00:50.00',and we tested the same assignation but just like this:***namestrcpy(rel-rd_rel-relfrequencytype,freqDef-frequencyMeasure);
//namestrcpy(rel-rd_rel-relfrequency,freqDef-frequencyMeasure)***And the result to the same query was:template1=# SELECT relname, relhasfrequency, relfrequencytype, relfrequency FROM pg_class WHERE relhasfrequency=true;


relname | relhasfrequency | relfrequencytype | relfrequency
- - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - -
test | t | '00:00:50.00' | 0
(1 row)
So please, anybody could tell me how to fix this?Thanks...-- Luis D. García M.Telf: 0414-3482018- FACYT - UC -- Computación -


Re: [HACKERS] ¿¿¿past chunk end???

2006-11-01 Thread luis garcia
Hi, thanks for your answers...Carefully check all the palloc's you are doing in your code.This warning is shown when you write some extra bytes to the memoryand size of your data goes beyond the allocated size.
There's no problem in the memory allocation, just in relfrequency, that's the Big Problem for me...Well, it's a bit hard to tell since you don't tell what changes you
actually made to the catalog. Did you remember to update the length tothe catalog entry and update the struct and all those details?Well about the changes I have made, they are working just fine. All the
structures length have been updated and as I said we added 7 new fieldsto pg_class structure and there was no problem. The problem here is with relfrequency only.
 What's the type of relfrequency actually?I'm sorry, but I forgot to show you the relfrequency definition in pg_class. Here It is:**
// FILE: pg_class.h// STRUCTURE: CATALOG(pg_class,1259) BKI_BOOTSTRAP...bool  relvalidtime; /* T if the table has a valid time attribute */NameData relvttype; /* The type of the valid time column of the table:
   * event, state or null (when the table isn't a TSQL2   * temporal table)*/int2  relvtprecision; /* The precision of the valid time column. By default 0 */
bool  reltranstime; /* T if the table has TSQL2 transaction time attribute */bool  relhasfrequency;/* relation has time frequency */NameData relfrequencytype;/* table time frequency type (REAL TIME, HISTORIC)*/
NameData relfrequency; /* table time frequency value*/...**These are the seven fields we just added, and as I said the only one with
problems is relfrequency. Much more info needed...
What else could be important there?Thanks again-- Luis D. García M.Telf: 0414-3482018- FACYT - UC -- Computación -


Re: [HACKERS] Problems starting Template1...

2006-10-26 Thread luis garcia
Hi, we all ready found the problem. I was creating the pg_class structure for 32 fields, but in the creation of Template1 I just inserted 29 initializationvalues, so the problem was that.Just like this:
Wrong CODE:DATA(insert OID = 1259 ( pg_class  PGNSP 83 PGUID 0 1259 0 0 0 0 0 f f r 32 0 0 0 0 0 t f f f f null 0 f _null_ ));Right CODE:DATA(insert OID = 1259 ( pg_class  PGNSP 83 PGUID 0 1259 0 0 0 0 0 f f r 32 0 0 0 0 0 t f f f f null 0 f f null 0 _null_ ));
If you see deep in there in the Wrong CODE there are just 29 values, butin the Right CODE are 32, just as it should be.Thanks anyway...2006/10/26, 
[EMAIL PROTECTED] [EMAIL PROTECTED]:-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1On Mon, Oct 23, 2006 at 02:32:47PM -0400, luis garcia wrote: Hello, I'm from Venezuela, and I've been making some modifications to Postgre's Catalog, but it seems to be a problem creating the Template1
 Database. When the creation of the database is starting this is what happens: [EMAIL PROTECTED]:~ /home/luis/pgsql/bin/initdb -D /home/luis/pgsql/data/[...] incorrect number of columns in row (expected 32, got 29)
 ^[...] I just added three more fields to pg_class structure (pg_class.h) just like this:Note that you are changing the core data structures of PostgreSQL. You
should change all the programs that work with them too :-)More to the point: what are you trying to achieve?Regards- -- tomás-BEGIN PGP SIGNATURE-Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFFQGUiBcgs9XrR2kYRAgOuAJ424LQIicJORfaQATng9xQzk9Fq0wCeKRW4bUtdKg/bsHA3Mc1XZg10k3U==/EF7-END PGP SIGNATURE--- Luis D. García M.Telf: 0414-3482018
- FACYT - UC -- Computación -


[HACKERS] Problems starting Template1...

2006-10-23 Thread luis garcia
Hello, I'm from Venezuela, and I've been making some modifications to Postgre's Catalog, but it seems to be a problem creating the Template1 Database. When the creation of the database is starting this is what happens:
[EMAIL PROTECTED]:~ /home/luis/pgsql/bin/initdb -D /home/luis/pgsql/data/The files belonging to this database system will be owned by user luis.This user must also own the server process.
The database cluster will be initialized with locale es_ES.UTF-8.The default database encoding has accordingly been set to UTF8.fixing permissions on existing directory /home/luis/pgsql/data ... ok
creating directory /home/luis/pgsql/data/global ... okcreating directory /home/luis/pgsql/data/pg_xlog ... okcreating directory /home/luis/pgsql/data/pg_xlog/archive_status ... okcreating directory /home/luis/pgsql/data/pg_clog ... ok
creating directory /home/luis/pgsql/data/pg_subtrans ... okcreating directory /home/luis/pgsql/data/pg_twophase ... okcreating directory /home/luis/pgsql/data/pg_multixact/members ... okcreating directory /home/luis/pgsql/data/pg_multixact/offsets ... ok
creating directory /home/luis/pgsql/data/base ... okcreating directory /home/luis/pgsql/data/base/1 ... okcreating directory /home/luis/pgsql/data/pg_tblspc ... okselecting default max_connections ... 100
selecting default shared_buffers ... 1000creating configuration files ... okcreating template1 database in /home/luis
/pgsql/data/base/1 ... FATAL: incorrect number of columns in row (expected 32, got 29)child process exited with exit code 1
initdb: removing contents of data directory /home/luis/pgsql/dataI just added three more fields to pg_class structure (pg_class.h) just like this:
..bool  relhasfrequency; /* has time frequency */NameData
 relfrequencytype; /* table time frequency type (REAL_TIME, HISTORIC)*/NameData relfrequency
; /* class time frequency value*/#define Natts_pg_class_fixed   31
#define Natts_pg_class 32#define Anum_pg_class_relname   1
#define Anum_pg_class_relnamespace 2...
DATA(insert OID = 1259 ( pg_class  PGNSP 83 PGUID 0 1259 0 0 0 0 0 f f r 32 0 0 0 0 0 t f f f f null 0 f _null_ ));...-pg_class- has originally 25 fields, and one of my friends has added four more
with no problems, but it seems to be a problem with the changes I've made, andwe don't know witch is it...I also made the next changes to pg_attribute.h:...{ 1259, {relhasfrequency},16, -1, 1, 29, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0 }, \
{ 1259, {relfrequencytype},  19, -1, NAMEDATALEN, 30, 0, -1, -1, false, 'p', 'i', true, false, false, true, 0 }, \{ 1259, {relfrequency}, 19, -1, NAMEDATALEN, 31, 0, -1, -1, false, 'p', 'i', true, false, false, true, 0 }, \
{ 1259, {relacl},  1034, -1, -1, 32, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0 }...DATA(insert ( 1259,relhasfrequency 16 -1 1 29 0 -1 -1 t p c t f f t 0));DATA(insert ( 1259,relfrequencytype  19 -1 NAMEDATALEN 30 0 -1 -1 f p i t f f t 0));
DATA(insert ( 1259,relfrequency   19 -1 NAMEDATALEN 31 0 -1 -1 f p i t f f t 0));DATA(insert ( 1259 relacl   1034 -1 -1 32 1 -1 -1 f x i f f f t 0));...If anyone could help me on this I would be very grateful, because this is the final
project of my Career... THANKS-- Luis D. García M.Telf: 0414-3482018- FACYT - UC -- Computación -


Re: [HACKERS] Constant changes (Re-Build)

2006-09-28 Thread luis garcia
Well Thanks you both for your answers, I really appreciate your opinions on this subject.

And Heikki I would really like to take a look to that book. If I have the chance to read it
I will tell you how the things go Ok...

Greets and Thanks one more time..2006/9/27, Heikki Linnakangas [EMAIL PROTECTED]:
luis garcia wrote: Hi I'm a student from Valencia-Venezuela and I'm working with some other friends to make PostgreSQL allows the definition of Temporal Databases and their respective Selection, Insertion and some other
 functions needed to treat this paradigm(all based in TSQL2 Query Language).That's interesting. May I suggest that you take a look at a book calledTemporal Data  the Relational Model by 
C.J. Date, Hugh Darwin andNikos Lorentzos(http://www.amazon.com/Temporal-Relational-Kaufmann-Management-Systems/dp/1558608559
).It describes the best approach I've seen this far to dealing withtemporal data. Right now we are working directly on the source code and making different changes during the day, so I'd like to ask you which is the
 better choice for re-building (I'm not sure if that is the right term) only the code files that I just have changed. I'm working on a Slow PC with not to many recourse, so every time I
 make (-configure/-make/-make-install/) i lose like 30 minutes of work, and I have been thinking in some other way to only re-configure the files I've recently changed.Well, you don't need to run configure every time you want to build. If
you just run make, it will compile just the changes. I'd suggestrunning the configure with the --enable-depend option, so it picks upchanges in header files better.Also take a look at ccache (
http://ccache.samba.org/). And if you havemore PCs to spare, you might want to set up distcc.--Heikki LinnakangasEnterpriseDB 
http://www.enterprisedb.com-- Luis D. García M.Telf: 0414-3482018- FACYT - UC -- Computación -


[HACKERS] Constant changes (Re-Build)

2006-09-26 Thread luis garcia
Hi I'm a student from Valencia-Venezuela and I'm working with some
other friends to make PostgreSQL allows the definition of Temporal 
Databases and their respective Selection, Insertion and some other
functions needed to treat this paradigm (all based in TSQL2 Query 
Language). 

Right now we are working directly on the source code and making 
different changes during the day, so I'd like to ask you which is the better
choice for re-building (I'm not sure if that is the right term) only the code
files that I just have changed.

I'm working on a Slow PC with not to many recourse, so every time I
make (-configure/-make/-make-install/) i lose like 30 minutes of work, 
and I have been thinking in some other way to only re-configure the files
I've recently changed.

Thanks anyway. I'll be waiting for your answer...-- Luis D. García M.Telf: 0414-3482018- FACYT - UC -- Computación -