I'm very confused. - Mailing list pgsql-novice
From | Brant Fitzsimmons |
---|---|
Subject | I'm very confused. |
Date | |
Msg-id | 45ADC565.6030906@bfcomputerconsulting.com Whole thread Raw |
Responses |
Re: I'm very confused.
Re: I'm very confused. Re: I'm very confused. |
List | pgsql-novice |
-----BEGIN PGP SIGNED MESSAGE----- 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@bfcomputerconsulting.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 brant@bfcomputerconsulting.com - ------------------------------------------------------------------- "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." -Plato -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFrcVlDpzwx2t8E5gRAv6BAJ9It2xCVv+f+iYridluQxQav7pv4wCffNQX fqy/kGwKA1RCcWkmuc3r8T4= =7liR -----END PGP SIGNATURE-----
pgsql-novice by date: