Re: Writing and Reading bytea

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Amit Gupta <amit(dot)pc(dot)gupta(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Emmanuel Cecchet <manu(at)frogthinker(dot)org>
Subject: Re: Writing and Reading bytea
Date: 2009-02-12 16:05:01
Message-ID: 499448AD.6000101@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-02-12 16:12:35 Re: pg_restore --multi-thread
Previous Message Heikki Linnakangas 2009-02-12 16:01:49 Re: Writing and Reading bytea