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: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Hi All !

I am get a some problem :

When i write in  php
$dbase=pg_connect(" 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(" 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 ?


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-2017 The PostgreSQL Global Development Group