Array of C integers to temporary table?

From: postgres-novice(at)coreland(dot)ath(dot)cx
To: pgsql-novice(at)postgresql(dot)org
Subject: Array of C integers to temporary table?
Date: 2009-01-27 13:04:42
Message-ID: 20090127130442.GA58365@logik.internal.network
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello.

What's the "correct" (read: simple, efficient) way to
pass an arbitrarily sized array of C integers to postgres
and have it turned into a temporary table?

I'm using PostgreSQL 7.4.

I could, of course, turn the array into a long list of
insert statements:

BEGIN;
CREATE TEMPORARY TABLE temp_table (id integer) ON COMMIT DROP;
INSERT INTO temp_table VALUES (1);
INSERT INTO temp_table VALUES (23);
INSERT INTO temp_table VALUES (3889);
...

But that seems long winded and rather inefficient.

Any help appreciated!

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lukas 2009-01-27 14:03:47 Re: Select START and MAXVALUE from Sequence
Previous Message A. Kretschmer 2009-01-27 10:49:11 Re: Select START and MAXVALUE from Sequence