Re: Writing and Reading bytea - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Writing and Reading bytea
Date
Msg-id 499448AD.6000101@enterprisedb.com
Whole thread Raw
In response to Writing and Reading bytea  (Amit Gupta <amit.pc.gupta@gmail.com>)
List pgsql-hackers
Amit Gupta wrote:
> We need insert rows to a catalog table that would store partitions info:
> 
> CATALOG(pg_partition,2336) BKI_WITHOUT_OIDS
> {
>     Oid         partrelid;      /* partition table Oid */
>     Oid         parentrelid;    /* Parent table Oid */
>     int2        parttype;       /* Type of partition, list, hash, range */
>     int2        partkey;        /* partition key */
>     Oid         keytype;        /* type of partition key */
>     int2        keyorder;       /* order of the key in multi-key partitions */
>     bytea       minval;
>     bytea       maxval;             /* min and max for range partition */
>     bytea       listval;
>     int2        hashval;            /* hash value */
> } FormData_pg_partition;

I realize you're still in early phase of hacking, but let me just point 
out that bytea is hardly the right data type for min/max value, unless 
the partitioning key is actually a bytea column. I can't suggest a 
better alternative off the top of my head. We have hacked around that 
problem in pg_statistic stavalues columns, but it really is a hack.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Writing and Reading bytea
Next
From: Andrew Dunstan
Date:
Subject: Re: pg_restore --multi-thread