Problem with array syntax

Поиск
Список
Период
Сортировка
От Web Manager
Тема Problem with array syntax
Дата
Msg-id 387B9297.1714E5D2@inter-resa.com
обсуждение исходный текст
Список pgsql-sql
Hello!

Since I am new at this and that my self testing is not working, can
someone help me with the syntax of creating an array and the way to
insert data in it?

In a tourism context, let's say that an hotel has 2 room type. I want a
2 month room availability table for each days... say 3 days for this
example!

The matrix would look like:

room_type      1 1 2 2
month          1 2 1 2
day1           3 4 2 4
day2           3 5 0 0
day3           0 2 1 2

where room_type is 1 or 2 
where month is 1 or 2 
where dayX is the day's number. So for the room_type 2, the 3rd day of
the 2sd month gives me "2" room availability.

would some thing like:
create table test (hotel_id varchar(8),type_ch int2[],mois int2[],jour
int2[]);

be ok?

How can I insert values so the array will allow me to scan a precice
position:

room type 1, first month, first day (= 3)

Thanks a lot!!!
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Andre Paquin


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] best strategy doing a large copy and using indexes
Следующее
От: Web Manager
Дата:
Сообщение: Problem with array syntax