🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #2906

Re: Database vs bestanden?

#2906
From: robert
Date: Thu, 04 Mar 2004 12:45
36 lines
2788 bytes
Erik Hensema <usenet@smac.hensema.net>:
 > robert ({n.c.p}@allyourbass.org.invalid) wrote:
 >>
 >> Daarna bevat capitals bij mij het volgende:
 >>
 >>  idcity    | integer | not null default nextval('cities_idcity_seq'::text)
 >
 > Dat klopt, en ook nog:
 >
 > Indexes: cities_pkey primary key btree (idcity)

Die zit er bij mij niet tussen (ik heb het over 'capitals', niet 'cities').

 > Probleem is dat die primary key niet in de child tables zit en je er dus
 > ook geen foreign keys naartoe kunt laten verwijzen.

Het vreemde is dat als ik idcity voor cities een primary key maak, dat
capitals w�l een 'serial' genaamd idcity krijgt, alleen voor capitals is
het niet automatisch een primary key.

Als ik achteraf idcity een primary maak, kan ik daarna gewoon die state
tabel aanmaken.

Kortom:
- CREATE TABLE voor 'oude' cities
- CREATE TABLE voor capitals
- ALTER TABLE voor cities; toevoegen 'idcity' en die primary key voor
  cities maken
- ALTER TABLE voor capitals; 'idcity' primary key maken (ik hoef 'em niet
  expliciet toe te voegen aan capitals)
- CREATE TABLE state

Dat werkt bij mij.

-- 
                                                                        robert
Technical Details
Message-ID: <slrnc4e96v.ch4.robert@home.allyourbass.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsgate.cistron.nl!news.cistron.nl!not-for-mail
References: <_et1c.22284$SL3.1605761@phobos.telenet-ops.be> <o7pc40515um0omqo4hnb2aqc2bb62d8028@4ax.com> <40467a4c$0$565$e4fe514c@news.xs4all.nl> <sjsd401e9mfd1r1hlo06rosdpg94gh3cv4@4ax.com> <c2722m.1fg.1@news.isolution.nl> <slrnc4e0tg.1ml.usenet@bender.home.hensema.net> <slrnc4e23g.ch4.robert@home.allyourbass.org> <slrnc4e3cb.1ml.usenet@bender.home.hensema.net> <slrnc4e4eb.ch4.robert@home.allyourbass.org> <slrnc4e6f3.2a2.usenet@bender.home.hensema.net> <slrnc4e7p4.ch4.robert@home.allyourbass.org> <slrnc4e8d4.2fl.usenet@bender.home.hensema.net>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII
X-Google-Thread: 107324,7a8fc8eaa24f5371
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,7a8fc8eaa24f5371
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2004-03-04 04:45:23 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsgate.cistron.nl!news.cistron.nl!not-for-mail
From: {n.c.p}@allyourbass.org.invalid (robert)
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: Database vs bestanden?
Date: Thu, 4 Mar 2004 12:45:20 +0000 (UTC)
Organization: All Your Bass Are Belong To Us
Lines: 36
Message-ID: <slrnc4e96v.ch4.robert@home.allyourbass.org>
References: <_et1c.22284$SL3.1605761@phobos.telenet-ops.be> <o7pc40515um0omqo4hnb2aqc2bb62d8028@4ax.com> <40467a4c$0$565$e4fe514c@news.xs4all.nl> <sjsd401e9mfd1r1hlo06rosdpg94gh3cv4@4ax.com> <c2722m.1fg.1@news.isolution.nl> <slrnc4e0tg.1ml.usenet@bender.home.hensema.net> <slrnc4e23g.ch4.robert@home.allyourbass.org> <slrnc4e3cb.1ml.usenet@bender.home.hensema.net> <slrnc4e4eb.ch4.robert@home.allyourbass.org> <slrnc4e6f3.2a2.usenet@bender.home.hensema.net> <slrnc4e7p4.ch4.robert@home.allyourbass.org> <slrnc4e8d4.2fl.usenet@bender.home.hensema.net>
NNTP-Posting-Host: cust.91.90.adsl.cistron.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: ncc1701.cistron.net 1078404320 14928 195.64.91.90 (4 Mar 2004 12:45:20 GMT)
X-Complaints-To: abuse@cistron.nl
NNTP-Posting-Date: Thu, 4 Mar 2004 12:45:20 +0000 (UTC)
User-Agent: slrn/0.9.7.4 (Darwin)