From: Ken McGlothlen <mcglk@serv.net>
To: pgsql-interfaces@hub.org
Subject: [Redirect] Simple CREATE TABLE in DBI::Pg?
Date: Wed, 17 Jun 1998 12:34:49 -0700 (PDT)
Message-ID: <199806171934.MAA06041@ralf.serv.net> (raw)
[I posted this to [GENERAL] on Sunday; scrappy@hub.org quite rightly pointed
out that it should go here. Voila.]
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
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: mcglk@serv.net, pgsql-interfaces@hub.org
Subject: Re: [Redirect] Simple CREATE TABLE in DBI::Pg?
In-Reply-To: <199806171934.MAA06041@ralf.serv.net>
* 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