In psql you could try: \c testdb Then create the table. \conninfo will tell you which db you are connected to. Carlo On 21 Feb 2014, at 4:25 PM, Tudor Girba <tudor@tudorgirba.com> wrote: Yupee! That worked fine. Thanks. I can move on now. Any idea how to connect to a non-default DB? Doru On Fri, Feb 21, 2014 at 3:22 PM, Carlo <snoobabk@gmail.com> wrote: Hi I just tried following your steps and had the exact same issues. What I now tried is connecting to default DB which seems to be your USER name which worked for me. So in your scenario connect to girba as DB instead of testdb and you should succeed. Cheers Carlo On 21 Feb 2014, at 4:16 PM, Tudor Girba <tudor@tudorgirba.com> wrote: Hi, On Fri, Feb 21, 2014 at 7:33 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote: Weird, you seem to have a DB connection. Exactly. So, that is good :) Try something that does not need a table, like select current_time; Thanks for the suggestion. Funny enough, this worked fine. Did you create 'testdb' and was 'testable' actually created there ? Can you connect to the DB on the command line ? $ psql testdb The DB seems to be created: girba=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+-------+----------+-------------+-------------+------------------- girba | girba | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | girba | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | girba | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/girba + | | | | | girba=CTc/girba template1 | girba | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/girba + | | | | | girba=CTc/girba testdb | girba | UTF8 | en_US.UTF-8 | en_US.UTF-8 | (5 rows) And the table seems to be created, too. I have: girba=# \dt List of relations Schema | Name | Type | Owner --------+-----------+-------+------- public | testtable | table | girba (1 row) Anything else I could test? Doru On 21 Feb 2014, at 06:55, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I am trying to get the Postgres support to work on Mac, but I have difficulties and I would need a bit of help.
Here is what I do:
1. Install Postgres from http://postgresapp.com
2. Open the psql console and create a test table: CREATE TABLE TESTTABLE ( ID int, TEXT varchar(255) );
3. In Pharo, load PostgresV2: Gofer new smalltalkhubUser: 'PharoExtras' project: 'PostgresV2'; configuration; load. (#ConfigurationOfPostgresV2 asClass project version: '2.0-baseline') load
4. In a Workspace: | conn | conn := PGConnection new. conn connectionArgs: (PGConnectionArgs hostname: 'localhost' portno: 5432 databaseName: 'testdb' userName: 'girba' password: ''). conn startup.
This works fine and the PGResult is good (if I use a wrong user, it tells me that the user does not exist).
5. However:
conn execute: 'SELECT * FROM TESTTABLE;'
==> PGErrorResponse(value='ERROR: relation "testtable" does not exist at character 15 ')
What am I missing?
Doru
-- www.tudorgirba.com
"Every thing has its own flow"
-- www.tudorgirba.com "Every thing has its own flow" -- www.tudorgirba.com "Every thing has its own flow"