X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 188C1D1D141 for ; Fri, 6 Feb 2004 21:48:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 16516-07 for ; Fri, 6 Feb 2004 17:48:48 -0400 (AST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by svr1.postgresql.org (Postfix) with ESMTP id 83006D1C517 for ; Fri, 6 Feb 2004 17:48:45 -0400 (AST) Received: from lightning (c-67-165-220-252.client.comcast.net[67.165.220.252]) by comcast.net (sccrmhc12) with SMTP id <2004020621484601200816lue>; Fri, 6 Feb 2004 21:48:46 +0000 From: "Marcel Wolf" To: Subject: Creating a new database at runtime. Date: Fri, 6 Feb 2004 14:46:47 -0700 Message-ID: <01fd01c3ecfa$bb3cd0d0$6401a8c0@Lightning> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01FE_01C3ECC0.0EDDF8D0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/22 X-Sequence-Number: 2570 This is a multi-part message in MIME format. ------=_NextPart_000_01FE_01C3ECC0.0EDDF8D0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hello I am trying to do the following: 1. startup my php app 2. check for its database under pgsql 3. If its not there it create it. 4. This may happen for several different apps. I add new apps all the time. Attempts: 1.I have tried to connect to the database and check the error for absence(pg_database) and then try to create it. This fails because the DATABASE missing is fatal. 2. I have tried to connect to template1 and check pg_database for my database and if it is not there create it. a. This works but I get the following warning, myindex is a serial field for my database. Do test this I go into phpPgAdmin and drop the addressbook database. Then I open my app to this error. When I refresh the screen everything works?! Warning: pg_query(): Query failed: ERROR: relation "info_myindex_seq" already exists . in /usr/local/apache2/htdocs/AddressBook/index.php on line 128 Could not create info tableERROR: relation "info_myindex_seq" already exists 3. If I repeat this sequence with a different app. It is the same performance but the new app has its tables and the tables from the first database?! 4. I have tried turning on the sql_inheritence to false without any help. 5. I cannot connect to template0. I do not understand the template0 concept, I am coming from the MYSQL world. Is there a way to do this????????? Marcel ------=_NextPart_000_01FE_01C3ECC0.0EDDF8D0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hello

I am trying to do the following:

    =         1. startup my php app

2. check for its database under pgsql

3. If its not there it create = it.

4. This may happen for several= different apps. I add new apps all the time.

 

Attempts:

1.I have tried to connect to t= he database and check the error for absence(pg_database) and then try to creat= e it. This fails because the DATABASE missing is fatal.<= /p>

2. I have tried to connect to template1 and check pg_database for my database and if it is not there crea= te it.

            a. This works but I get the following warning, myindex is a serial field for my database. Do test this I go into phpPgAdmin and drop the addressbook databa= se. Then I open my app to this error. When I refresh the screen everything work= s?!

 

 

= Warning: pg_query(): Query failed: ERROR: relation "info_myindex_seq" alre= ady exists . in /usr/local/apache2/htdocs/A= ddressBook/index.php on line 128
Could not create info tableERROR: relation "info_myindex_seq" alr= eady exists

 

 =

3. If I rep= eat this sequence with a different app. It is the same performance but the new app h= as its tables and the tables from the first database?!

4. I have t= ried turning on the sql_inheritence to false without any help.=

5. I cannot= connect to template0.

 =

 =

 =

I do not un= derstand the template0 concept, I am coming from the MYSQL world. Is there a way to = do this?????????

 =

 =

Marcel

------=_NextPart_000_01FE_01C3ECC0.0EDDF8D0--