Re: About Maximum number of columns

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: About Maximum number of columns
Дата
Msg-id 43AA97D6.2080609@archonet.com
обсуждение исходный текст
Ответ на Re: About Maximum number of columns  (zhaoxin <zhaox@necas.nec.com.cn>)
Список pgsql-general
zhaoxin wrote:
> I have to face this trouble , it is not I want , but a historical problem .
> so , can you tell me ?

Sure, but you'll need to say what column-types you have.

Below is a small script to generate a table with lots of columns.

#!/bin/perl -w
use strict;

my $tbl = 'test_text';
my $typ = 'text';
my $num_cols = 1500;

print "CREATE TABLE $tbl (\n";
for (my $c=0; $c<$num_cols; $c++) {
    print "  col$c $typ,\n";
}
print "PRIMARY KEY (col0)\n";
print ");\n";
exit;

You can run it with something like:
  perl mk_script.pl | psql -Urichardh richardh

--
  Richard Huxton
  Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: Tino Wildenhain
Дата:
Сообщение: Re: About Maximum number of columns
Следующее
От: Zlatko Matić
Дата:
Сообщение: ODBC connection string, MS Access