I have a inventory system design in which I would like some help with to
see if it's efficient. The products are broken into:
Product tables
Property tables
Configurable Products - this would include colors (i.e. - black, blue
and green) tied to products
I'm thinking of breaking inventory in
so, after the needed modifications the SQL schema is the following
-- SQL schema for business-test-db2
CREATE TABLE customers (
customer_code serial UNIQUE,
alfa_customer_code varchar(6),
customer_name character varying(250) NOT NULL,
address character varying(250) NOT NULL,
city chara
[cut]
Given this table layout, I'm gonna take a wild guess and ask if you're
coming from MySQL and expecting the second serial order_code to be a
sub-autoincrement to id?
no, always used PostgreSQL, but i'm having a deeper approach now, until
now i've been using th ORDBMS in a very 'easy' mann
[cut]
It means what it says. You have defined table orders with a primary
key of (id,order_code). This means that the combination of
(id,order_code) must be unique.
yes, that was my thought, and in that context, i thought it could be
correct in order to have uniqueness for creating forei
Jaime Casanova wrote:
[...unnecesary...]
CREATE TABLE orders (
id serial,
order_code serial,
customer_code integer REFERENCES customers (customer_code) NOT NULL,
order_date time without time zone NOT NULL,
remote_ip inet NOT NULL,
order_time timestamp with time zone NOT NULL,
order_t
John McCawley wrote:
Table orders defines the column order_code as a serial, which simple
makes a trigger which gives a new value to the column on insert. Note
that there is NO guarantee that ths column will be unique. You can
manually update the value to whatever you want. If you wish this
[cut]
order_code is not by itself unique --- SERIAL doesn't guarantee that.
that was my misunderstanding, i thought (misunderstood) that 'serial'
implied 'unique'
I'm not sure why you are declaring the primary key of orders as being
the combination of *two* serial columns,
i thought it
On Tue, 2005-12-13 at 12:16, Gianluca Riccardi wrote:
> hello all,
> i'm usign PostgreSQL 7.4.7 in a Debian 3.1
>
> following is the SQL schema of my (very)small DB for a (very small)web
> business application:
> CREATE TABLE orders (
>id serial,
>order_code serial,
>customer_code i
Gianluca Riccardi wrote:
hello all,
i'm usign PostgreSQL 7.4.7 in a Debian 3.1
CREATE TABLE orders (
id serial,
order_code serial,
...
PRIMARY KEY (id, order_code)
);
CREATE TABLE order_items (
id serial,
order_code integer REFERENCES orders (order_code) NOT NULL,
when i try t
[...unnecesary...]
> CREATE TABLE orders (
> id serial,
> order_code serial,
> customer_code integer REFERENCES customers (customer_code) NOT NULL,
> order_date time without time zone NOT NULL,
> remote_ip inet NOT NULL,
> order_time timestamp with time zone NOT NULL,
> order_type va
Gianluca Riccardi <[EMAIL PROTECTED]> writes:
> CREATE TABLE orders (
>id serial,
>order_code serial,
>customer_code integer REFERENCES customers (customer_code) NOT NULL,
>order_date time without time zone NOT NULL,
>remote_ip inet NOT NULL,
>order_time timestamp with time
Table orders defines the column order_code as a serial, which simple
makes a trigger which gives a new value to the column on insert. Note
that there is NO guarantee that ths column will be unique. You can
manually update the value to whatever you want. If you wish this column
to be unique,
hello all,
i'm usign PostgreSQL 7.4.7 in a Debian 3.1
following is the SQL schema of my (very)small DB for a (very small)web
business application:
-- SQL schema for business-test-db
CREATE TABLE customers (
customer_code serial,
alfa_customer_code varchar(6),
customer_name character var
13 matches
Mail list logo