First, please ALWAYS include the version and O/S, even with basic questions.

I'm not sure what you mean by doubles. Do you mean bigint data type, or do
you mean use two columns for a primary key? Either way it's pretty simple.
If you mean a bigint, then probably best to use serial data type, which
will default to the next value.
If you mean use two columns for a Primary Key, the you just specify the
columns.
EG: CONSTRAINT PRIMARY KEY table_name_pk PRIMARY KEY (col1, col2)


On Fri, Apr 17, 2015 at 11:34 AM, Kynn Jones <kyn...@gmail.com> wrote:

> I have some data in the form of a matrix of doubles (~2 million
> rows, ~400 columns) that I would like to store in a Pg table,
> along with the associated table of metadata (same number of rows,
> ~30 columns, almost all text).  This is large enough to make
> working with it from flat files unwieldy.
>
> (The only reason for wanting to transfer this data to a Pg table
> is the hope that it will be easier to work with it by using SQL
> queries to extract subsets of it, than by, e.g., writing programs
> that must scan the entire matrix every time they're run.)
>
> My plan is to add one extra column to the Pg tables to serve as
> the primary key joining the data and the metadata tables
> together.
>
> One consideration that is complication the choice of primary key
> is wanting to have the ability to store chunks of the data
> table (not the metadata table), including the PK column, as
> matrices of doubles.  In its simplest form, this would mean using
> doubles as primary keys, but this seems to me a bit weird.
>
> I'm willing to go ahead with this, but I wanted to ask for your
> feedback on the whole thing.  In particular I'd like to know if
> there are there standard ways for using doubles as primary keys,
> and, conversely, if there are known pitfalls I should be looking
> out for, but I welcome any other words of wisdom you may have on
> this topic.
>
> Thanks in advance!
>
> kj
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



-- 
*Melvin Davidson*
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

Reply via email to