pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry A Brutckevich <owld@mail.ru>
To: pgsql-interfaces@postgresql.org
Subject: SERIAL type in PHP
Date: Tue, 14 Sep 1999 13:17:41 +0400
Message-ID: <37DE12B5.D7B3A714@mail.ru> (raw)

Hi All !


I am get a some problem :

When i write in  php
<?php
$dbase=pg_connect("host=somehost.domain.ru user=$login  password=$pass
port=5432 dbname=maindb");
$result=pg_Exec($dbase, "  CREATE table users (userid serial) ");
?>
my brower ( and log on server ) write to me :

Warning: PostgresSQL query failed: pqReadData() -- backend closed the
channel unexpectedly. This probably means the backend terminated
abnormally before or while processing the request. in
/usr/local/rubin/system/generating.phtml on line 134

I am rewrite:

$dbase=pg_connect("host=somehost.domain.ru user=$login  password=$pass
port=5432 dbname=maindb");
$result=pg_Exec($dbase, "  CREATE SEQUENCE users_userid_seq ");
$result=pg_Exec($dbase, " CREATE TABLE users ( userid INT4 DEFAULT
nextval('users_userid_seq')) ");
$result=pg_Exec($dbase, " CREATE UNIQUE INDEX users_userid_key on users
(userid) " );

And all work properly. No warnings.

Where is problem ?

Dmitry





Message-ID: <37DE12B5.D7B3A714@mail.ru>
Permalink:  ../37DE12B5.D7B3A714@mail.ru/
Also on:    postgresql.org/message-id/37DE12B5.D7B3A714@mail.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: owld@mail.ru
  Subject: Re: SERIAL type in PHP
  In-Reply-To: <37DE12B5.D7B3A714@mail.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox