Problem with array syntax - Mailing list pgsql-sql

From Web Manager
Subject Problem with array syntax
Date
Msg-id 387B99FD.29C3B43F@inter-resa.com
Whole thread Raw
List 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 by date:

Previous
From: Web Manager
Date:
Subject: Problem with array syntax
Next
From: Prakash
Date:
Subject: mdopen: couldn't open