Skip site navigation (1) Skip section navigation (2)

I'm very confused.

From: Brant Fitzsimmons <brant(at)bfcomputerconsulting(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: I'm very confused.
Date: 2007-01-17 06:42:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hash: SHA1

Hi there,

I think that this may be my first post to this list so be gentle.

I'm having a very strange problem (to me) and I hope that someone can
shed some light on what I'm not seeing.

I created a database and table from the command line using: sudo su
postgres createdb test

That worked fine and created the stated table.

I then logged in using: sudo su postgres psql test

Again, that worked fine.

I created a table from the prompt using: create table users (userID
serial, userName varchar(32), firstName varchar(32), lastName
varchar(64), email varchar(128));

The table was successfully created.  So good so far.  Don't mind the
values of the varchar's; this is purely for testing.

I then added a primary key to the table using:  alter table users add
primary key (userId);

Again, it worked.

Here's where it starts to get weird.

I inserted data into the table using: insert into users (username,
firstName, lastName, email) values ('bfitzsimmons', 'Brant',
'Fitzsimmons', 'brant(at)bfcomputerconsulting(dot)com');

It went in properly and I was able to select the inserted data without
any problems (select * from users;).

I then wrote a python script to insert and select data from the
table.  The script is able to insert and retrieve data without any
problems...*but*...from the console I can't retrieve any of the
records inserted by the script.

Records that are entered at the console show up when I do a select
with the script, but not the other way around.  I have tried to the
RTFM as much as possible, but I'm still lost as to why while accessing
the same table I can't access the data manipulated by the script.  I
don't know if it has anything to do with tablespaces or what, but I'm
really starting to get frustrated.

I'm from a MySQL background and I'm completely stumped as to how you
can, through a script, insert data into a database *created at the
console* and not be able to select that data from the console.  I know
it's there taking up space on my machine, and I can select it from the
script, but I can't manipulate it in any way outside of that.

Any thoughts?

- --
Brant Fitzsimmons
- -------------------------------------------------------------------
"Strange times are these in which we live when the old and the
young are taught falsehoods in the schools of learning. And the one
man that dares to tell the truth is called at once a lunatic and
a fool."
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla -



pgsql-novice by date

Next:From: Alan HodgsonDate: 2007-01-17 06:59:19
Subject: Re: I'm very confused.
Previous:From: Brandon AikenDate: 2007-01-17 00:13:08
Subject: Re: Question about the need to specify column column definition list for functions returning "record"

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group