pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedTake two: Simple CREATE TABLE in DBI::Pg?
4+ messages / 2 participants
[nested] [flat]
* Take two: Simple CREATE TABLE in DBI::Pg?
@ 1998-06-21 07:37 Ken McGlothlen <mcglk@serv.net>
0 siblings, 1 reply; 4+ messages in thread
From: Ken McGlothlen @ 1998-06-21 07:37 UTC (permalink / raw)
To: pgsql-interfaces@hub.org
[This is the second time I've asked this on this list. Is anyone else getting
my messages? I would *really* like to get an answer here.]
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] Take two: Simple CREATE TABLE in DBI::Pg?
@ 1998-06-21 10:50 Felix Morley Finch <felix@crowfix.com>
parent: Ken McGlothlen <mcglk@serv.net>
0 siblings, 1 reply; 4+ messages in thread
From: Felix Morley Finch @ 1998-06-21 10:50 UTC (permalink / raw)
To: Ken McGlothlen <mcglk@serv.net>; +Cc: pgsql-interfaces@hub.org
>>In article <199806210737.AAA20815@ralf.serv.net>, Ken McGlothlen <mcglk@serv.net> writes:
> [This is the second time I've asked this on this list. Is anyone
> else getting my messages? I would *really* like to get an answer
> here.]
> 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->commit;
> }
> $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.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
PGP = 91 B3 94 7C E9 E8 76 2D E1 63 51 AA A0 48 89 2F ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] Take two: Simple CREATE TABLE in DBI::Pg?
@ 1998-06-21 23:17 Ken McGlothlen <mcglk@serv.net>
parent: Felix Morley Finch <felix@crowfix.com>
0 siblings, 1 reply; 4+ messages in thread
From: Ken McGlothlen @ 1998-06-21 23:17 UTC (permalink / raw)
To: Felix Morley Finch <felix@crowfix.com>; +Cc: pgsql-interfaces@hub.org
felix@crowfix.com (Felix Morley Finch) writes:
| >>Ken McGlothlen <mcglk@serv.net> writes:
|
| > $sth->execute();
| =====> $dbh->commit;
(* roll eyes, pound self on head *) Thank you, Felix, for succinctly and
patiently pointing out my silliest mistake this month. :)
(Woo-hoo! I'm on my way!)
---Ken
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] Take two: Simple CREATE TABLE in DBI::Pg?
@ 1998-06-22 02:56 Felix Morley Finch <felix@crowfix.com>
parent: Ken McGlothlen <mcglk@serv.net>
0 siblings, 0 replies; 4+ messages in thread
From: Felix Morley Finch @ 1998-06-22 02:56 UTC (permalink / raw)
To: pgsql-interfaces@hub.org
>>In article <199806212317.QAA23037@ralf.serv.net>, Ken McGlothlen <mcglk@serv.net> writes:
> (* roll eyes, pound self on head *) Thank you, Felix, for succinctly and
> patiently pointing out my silliest mistake this month. :)
See, I figure if I were perfect, I wouldn't even have to subscribe to
any mailing list. It's also easiest to recognize mistakes similar to
my own :-)
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
PGP = 91 B3 94 7C E9 E8 76 2D E1 63 51 AA A0 48 89 2F ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~1998-06-22 02:56 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-06-21 07:37 Take two: Simple CREATE TABLE in DBI::Pg? Ken McGlothlen <mcglk@serv.net>
1998-06-21 10:50 ` Felix Morley Finch <felix@crowfix.com>
1998-06-21 23:17 ` Ken McGlothlen <mcglk@serv.net>
1998-06-22 02:56 ` Felix Morley Finch <felix@crowfix.com>
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