Обсуждение: Why can't I connect to postgres?

Поиск
Список
Период
Сортировка

Why can't I connect to postgres?

От
"Theodore H. Smith"
Дата:
I just installed Postgres for Mac.

Also, where is a nice browser/editor for postgres? Something like the
OpenBase manager, but for Postgres. Something friendly and neat and
simple. I'm sick of all these stupid syntax errors making me spend
half a day doing something I could do in 1 minute.

I tried SyBrowserX, but it wouldn't connect. I tried an SQL browser
that I wrote myself in REALbasic, and it also wouldn't connect. Why
can't I connect to postgres??

I haven't got very far and yet I'm already seeing problems. I'm
assuming there's a simple solution.

--
http://elfdata.com/plugin/




Re: Why can't I connect to postgres?

От
John DeSoi
Дата:
On Jul 24, 2006, at 11:21 AM, Theodore H. Smith wrote:

> I just installed Postgres for Mac.
>
> Also, where is a nice browser/editor for postgres? Something like
> the OpenBase manager, but for Postgres. Something friendly and neat
> and simple. I'm sick of all these stupid syntax errors making me
> spend half a day doing something I could do in 1 minute.
>
> I tried SyBrowserX, but it wouldn't connect. I tried an SQL browser
> that I wrote myself in REALbasic, and it also wouldn't connect. Why
> can't I connect to postgres??
>
> I haven't got very far and yet I'm already seeing problems. I'm
> assuming there's a simple solution.


See these pages for free/commercial GUI tools:

http://www.postgresql.org/download/

http://www.postgresql.org/download/commercial


pgAdmin III, Navicat, and pgEdit have Mac versions.


If you still can't connect, you need to give more info about the
error you are getting. Also, you can usually look in the PostreSQL
log file to help identify connection problems.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: Why can't I connect to postgres?

От
"Theodore H. Smith"
Дата:
Well I tried NaviCat and some others, they seem to work. Perhaps the
problem was with REALbasic.

I can connect via perl, also, which is good.

What's a good way to store the database logic?

Say for example, I want to do something to the database, can I just
say something like DataBasePleaseTryRegisterUser( "name", "details",
"serial", "etc" ); where DataBasePleaseTryRegisterUser would be some
kind of function stored in the database itself?

Or should I put the logic into my perl files? And treat the database
as just that, a blind database which can store invalid data.



Re: Why can't I connect to postgres?

От
"Raymond O'Donnell"
Дата:
On 24 Jul 2006 at 17:57, Theodore H. Smith wrote:

> Say for example, I want to do something to the database, can I just
> say something like DataBasePleaseTryRegisterUser( "name", "details",
> "serial", "etc" ); where DataBasePleaseTryRegisterUser would be some
> kind of function stored in the database itself?
>
> Or should I put the logic into my perl files? And treat the database
> as just that, a blind database which can store invalid data.

You can do either. I suppose which you go for depends on what you
want your application to do - For example, I frequently have to log
all changes to the data, in which case I find it best to write a
function which doe the logging and then call that function from
within other functions that do the updates - this way the log is
written within the same transaction as the update, with the resulting
peace of mind a major benefit!

--Ray.


----------------------------------------------------------------------

Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod@iol.ie
----------------------------------------------------------------------



Re: Why can't I connect to postgres?

От
John DeSoi
Дата:
On Jul 24, 2006, at 12:57 PM, Theodore H. Smith wrote:

> Well I tried NaviCat and some others, they seem to work. Perhaps
> the problem was with REALbasic.

I don't know the details of REALBasic, but perhaps it uses ODBC or
some other "generic" connection method. In this case, you probably
have to do some additional setup and configuration.

>
> I can connect via perl, also, which is good.
>
> What's a good way to store the database logic?
>
> Say for example, I want to do something to the database, can I just
> say something like DataBasePleaseTryRegisterUser( "name",
> "details", "serial", "etc" ); where DataBasePleaseTryRegisterUser
> would be some kind of function stored in the database itself?
>
> Or should I put the logic into my perl files? And treat the
> database as just that, a blind database which can store invalid data.

PostgreSQL has excellent stored procedure/function support. I prefer
to use that whenever possible. The starting points are CREATE
FUNCTION and pl/pgsql:

http://www.postgresql.org/docs/8.1/interactive/sql-createfunction.html

http://www.postgresql.org/docs/8.1/interactive/plpgsql.html




John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL