Skip site navigation (1) Skip section navigation (2)

SERIAL type in PHP

From: Dmitry A Brutckevich <owld(at)mail(dot)ru>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: SERIAL type in PHP
Date: 1999-09-14 09:17:41
Message-ID: 37DE12B5.D7B3A714@mail.ru (view raw or flat)
Thread:
Lists: pgsql-interfaces
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



pgsql-interfaces by date

Next:From: Nuchanach KlinjunDate: 1999-09-14 09:31:53
Subject: ODBC
Previous:From: Andreas TheofiluDate: 1999-09-14 08:34:38
Subject: Found error with apostrophes in ecpg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group