analyze.c

Поиск
Список
Период
Сортировка
Искать

analyze.c

От:
"Anja Klein" <Kruemelmonster_81@web.de>
Дата:
Hi guys,

during my study i have to du some practical work. i must extend postgresql with some sampling algorithms. therefore i implemented some trigger functions. it works fine.
but now i have to do some changes concerning the parser, particularly analyze.c . if a user sends an create table command, postgresql should create several sample tables, which will be filled wih the sample data from the original table. for the beginning, it would be enough, if two tables are created, the original one, with table name, columns etc. selectd by the user and second one, a copy with same columns etc, but another name e.g. sample.

my problem is, that the system catalogs are created at "initdb". then the following failure occurs:

loading pg_description... /usr/local/pqsql/initdb: line 837: 22348 Done (141)          (cat </dev/null

how can i tell postgres. that it should only create the sample table, when the original table to be created has the name "origin" or something like that? or that it should only act, if some user wants to create the table, not postgres itself? 

thank you very much!

greetings, anja
_______________________________________________________
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern
Informationen unter: http://freemail.web.de/?mc=021199


Re: analyze.c

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Anja Klein wrote:
> how can i tell postgres. that it should only create the sample table,
> when the original table to be created has the name "origin" or
> something like that? or that it should only act, if some user wants
> to create the table, not postgres itself?

You would presumably do a strcmp() on the name of the table to be 
created before you jump into your new code that creates the sample 
table.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


FAQ