Re: Moving from MySQL to PGSQL....some questions (multilevel

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: Moving from MySQL to PGSQL....some questions (multilevel
Дата
Msg-id Pine.LNX.4.33.0403031134570.8436-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Re: Moving from MySQL to PGSQL....some questions (multilevel  (Paulovič Michal <michal@paulovic.sk>)
Ответы Re: Moving from MySQL to PGSQL....some questions (multilevel
Список pgsql-general
On Wed, 3 Mar 2004, [UTF-8] Paulovič Michal wrote:

> Yes I know,
>
> But how you do this at PgSQL????

OK, I just read the response where someone showed me how to make such a
table in mysql.  What an odd, and non-intuitive behaviour that is.

Anyway, first off, upgrade your version of postgresql to 7.4.x .  7.1 is
VERY old, and is no longer maintained.  IT would suck to develop all this
for 7.1 only to find out some minor bug fix gets in your way of upgrading.

Next, what you need is a before trigger that will take any row being
inserted, select the max(id2) where id1 = whatwereinserting adds one to it
and makes that the new id2.

Look up before triggers.  plpgsql is a good language to do this in.  Note
that on large tables it WILL BE SLOW.



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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: How index are running and how to optimise ?
Следующее
От: Michael Chaney
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions (multilevel