[SQL] Re: START for SERIAL type?

2001-06-05 Thread Frank Contrepois

read the doc section datatype!!!
serial just create a sequence on a standard way, if you dont like it you'll
have to create your sequence.
bye
--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] Re: INSERT value of type table

2001-06-05 Thread Frank Contrepois

> exemple:
> CRETAE TABLE Address (Number integer, Street varchar, city varchar, contry
> varchar);
> CREATE TABLE Person (Name varchar, addr Address);
> INSERT INTO addrerss VALUES ( 5, 'rue du pont',  'Lyon', 'France');
> The question is :
> How we can insert a new person whose address is that inserted in the
> table of the addresses.

CREATE TABLE Address (Number integer PRIMARY KEY, Street varchar, City
varchar, Country varchar)
CREATE TABLE Person (Name varchar, addr integer REFERENCES TO Address)

this is called a FOREIGN KEY.. look at some doc for it. this is the way
Relational DB works
bye
--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: Is it possible to defer triggers?

2001-06-05 Thread Frank Contrepois

read this:
http://www.postgresql.org/idocs/index.php?sql-createtrigger.html

bye
--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] Re: Slow inserts/deletes

2001-06-05 Thread Frank Contrepois

If you use index on this table it's better to:
1) drop all index on the table
2) do the insert
3) (re)create the indexes


--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster