Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't Make Table
    primarykey
    data
    text
    <p>I recently made a postgresql database but for some reason I cannot make a table in it. I am fine whether I can create it from a php script or with terminal; but I have searched many places and can't find anything that works. I have done a bunch of work before in mysql but postgresql just happens to be giving me problems.</p> <p>I know on my php file I am properly connected to my database and I have ran numerous versions of this script like (inserted after the pg_connect):</p> <pre><code>$tsk1 = pg_query(" CREATE TABLE IF NOT EXISTS `elb` ( `id` int(8) NOT NULL AUTO_INCREMENT, `user` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `pass` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`_id`), UNIQUE KEY `_user` (`_user`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3"); </code></pre> <p>and I have also tried</p> <pre><code> $tsk1 = pg_query(" CREATE TABLE IF NOT EXISTS 'elb' ( 'id' int(8), 'user' varchar(128), 'pass' varchar(128), 'name' varchar(128), "); </code></pre> <p>I also tried this but got a 500 error. And I know I am connected because I tried just changing one character in my password and it returned 'Could not connect'.</p> <pre><code>&lt;?php $dbconn = pg_connect("host=hostname port=portnum dbname=mydb user=myuser password=mypass sslmode=require options='--client_encoding=UTF8'") or die('Could not connect: ' . pg_last_error()); $sql = pg_query('CREATE TABLE "elb" ( "id" int(8), "user" varchar(128), "pass" varchar(128), "name" varchar(128) )'); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload