From: | Ken McGlothlen <mcglk(at)serv(dot)net> |
---|---|
To: | pgsql-general(at)hub(dot)org |
Subject: | Simple CREATE TABLE in DBI::Pg? |
Date: | 1998-06-14 20:09:38 |
Message-ID: | 199806142009.NAA24805@ralf.serv.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Here's the program, in Perl; I've pared it down to the bare minimum:
#!/usr/local/bin/perl
use DBI;
sub tbl_easy_init {
local( $dbh ) = shift;
local( $sth ) = $dbh->prepare( "create table tbl_easy (id int4)" );
$sth->execute();
}
$dbh = DBI->connect( "dbi:Pg:dbname=booga", "", "",
{ "PrintError" => 0, "AutoCommit" => 0 } );
$rv = &tbl_easy_init( $dbh );
This program fails. I've tried it with all global variables, tried a number of
different CREATE TABLE statements, and so on, and $rv always winds up being
equal to -1. Yet, typing in the CREATE TABLE statement in psql works.
If the table is already created in psql, I can use all manner of select
statements in the above program skeleton, and it'll work.
So. What am I doing wrong?
---Ken
From | Date | Subject | |
---|---|---|---|
Next Message | Jake Fear | 1998-06-14 22:33:44 | subscribe |
Previous Message | info | 1998-06-14 16:35:40 | Autoresponder-Family Tree Chart |