Thread: Getting Started newbie questions)
I'm new to both Linux and Postgres I installed Red Hat 8 on a stand-alone test machine yesterday. I did a custom install, and installed everything. So my assumption is that everything Red Hat 8 could install was installed, including Postgresql. I went into Server Settings, Services, and in Service Configuration found postgresql. I checked it, so that it would start on reboot. The machine has since been rebooted The tutorial says the Postgresql is stored in /usr/local/pgsql/ and /usr/local/pgsql/data. I don't see either one, either as me (Steve) or as root. I do see files under /usr/lib/, usr/share/, and usr/include. The tutorial says to try to create a new database with $ createdb mydb I get the error: psql: FATAL 1: user "Steve" does not exist createdb: database creation failed. This sounds to me like postmaster is running. But what do I know? The tutorial says to try the command with the absolute path: /usr/local/pgsql/bin/createdb mydb I get the error: No such file or directory No surprise there. I already saw that I couldn't find a /usr/local/pgsql Steve
type in "which psql". This will tell you where psql is installed, along with all of the other binaries.
to resolve the error "psql: FATAL 1: user "Steve" does not exist", you need to create a postgres user named steve. here is how:
[drajput@challenger etc]$ su <-- log in as root
Password: <-- key in root passwd
[root@challenger etc]# su -l postgres <-- swith over to the user name "postgres"
[postgres@challenger postgres]$ createuser steve <-- add a new postgres user account steve.
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
CREATE USER
[postgres@challenger postgres]$
regards,
Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474
Steve_Miller@sil.org Sent by: pgsql-novice-owner@postgresql.org 01/09/2003 10:56 AM | To: pgsql-novice@postgresql.org cc: Subject: [NOVICE] Getting Started newbie questions) |
I'm new to both Linux and Postgres
I installed Red Hat 8 on a stand-alone test machine yesterday. I did a
custom install, and installed everything. So my assumption is that
everything Red Hat 8 could install was installed, including Postgresql.
I went into Server Settings, Services, and in Service Configuration found
postgresql. I checked it, so that it would start on reboot. The machine has
since been rebooted
The tutorial says the Postgresql is stored in /usr/local/pgsql/ and
/usr/local/pgsql/data. I don't see either one, either as me (Steve) or as
root. I do see files under /usr/lib/, usr/share/, and usr/include.
The tutorial says to try to create a new database with
$ createdb mydb
I get the error:
psql: FATAL 1: user "Steve" does not exist
createdb: database creation failed.
This sounds to me like postmaster is running. But what do I know?
The tutorial says to try the command with the absolute path:
/usr/local/pgsql/bin/createdb mydb
I get the error:
No such file or directory
No surprise there. I already saw that I couldn't find a /usr/local/pgsql
Steve
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Steve_Miller@sil.org writes: > I'm new to both Linux and Postgres Welcome to the club > I installed Red Hat 8 on a stand-alone test machine yesterday. I did > a custom install, and installed everything. So my assumption is that > everything Red Hat 8 could install was installed, including > Postgresql. You will soon find out that in Linux installing *everything* gets a lot of stuff installed. That's handy when you are first learning to use Linux (you don't have to worry about installing things later), but it's probably not a good idea on a production machine. > I went into Server Settings, Services, and in Service Configuration found > postgresql. I checked it, so that it would start on reboot. The machine has > since been rebooted > > The tutorial says the Postgresql is stored in /usr/local/pgsql/ and > /usr/local/pgsql/data. I don't see either one, either as me (Steve) or as > root. I do see files under /usr/lib/, usr/share/, and usr/include. The tutorial supposes that you installed from source code. /usr/local is where you should install packages that you install from source code instead of via RPM. On my Debian machine the actual database is stored in /var/lib/postgres, and the various binaries are somewhere in the /usr diretories RedHat is probably similar. Learning the hows, whys, and wheres of the Linux filesystem is pretty useful stuff, but it isn't necessary for running PostgreSQL. > The tutorial says to try to create a new database with > > $ createdb mydb > > I get the error: > > > psql: FATAL 1: user "Steve" does not exist > createdb: database creation failed. That's actually a good sign. It would appear that PostgreSQL is up and running, the problem is that you don't have a PostgreSQL user named "Steve" yet. What you need to do is create such a user. To do so you will need to change to the postgres user. Since the postgres user probably doesn't have a password (for security reasons) this is a two step process. 1. Change to the root user using the `su' command: su (you will need to type in the root password). 2. Change to the postgres user using the su command again. I usually do this by typing: su - postgres You can read the su man page by typing `man su' to see why it is that I called it that way. Once you are logged in as the postgres user you should be able to run all of the createdb and createuser commands that you want. > This sounds to me like postmaster is running. But what do I know? > > The tutorial says to try the command with the absolute path: > > /usr/local/pgsql/bin/createdb mydb > > I get the error: > > No such file or directory > > No surprise there. I already saw that I couldn't find a /usr/local/pgsql > > Steve Yes, PostgreSQL isn't installed in that directory. Try typing: which createdb this should show you where createdb is actually installed. You also might want to play with the `locate' command. Good Luck, Jason
Redhat builds postgresql in /var/lib/pgsql Ron Peck Software Engineer Associated Creditors Exchange (602) 650-5918 -----Original Message----- From: Steve_Miller@sil.org [SMTP:Steve_Miller@sil.org] Sent: Thursday, January 09, 2003 9:56 AM To: pgsql-novice@postgresql.org Subject: [NOVICE] Getting Started newbie questions) I'm new to both Linux and Postgres I installed Red Hat 8 on a stand-alone test machine yesterday. I did a custom install, and installed everything. So my assumption is that everything Red Hat 8 could install was installed, including Postgresql. I went into Server Settings, Services, and in Service Configuration found postgresql. I checked it, so that it would start on reboot. The machine has since been rebooted The tutorial says the Postgresql is stored in /usr/local/pgsql/ and /usr/local/pgsql/data. I don't see either one, either as me (Steve) or as root. I do see files under /usr/lib/, usr/share/, and usr/include. The tutorial says to try to create a new database with $ createdb mydb I get the error: psql: FATAL 1: user "Steve" does not exist createdb: database creation failed. This sounds to me like postmaster is running. But what do I know? The tutorial says to try the command with the absolute path: /usr/local/pgsql/bin/createdb mydb I get the error: No such file or directory No surprise there. I already saw that I couldn't find a /usr/local/pgsql Steve ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
I have tried inserting a string with Unicode character, and then a non-English ASCII character into a postgres DB on cygwin from pgAdminII. Both failed. Unicode actually displays as its equivalent ASCII in the tool, and that probably has to do with pgAdmin rather than postgres and is not a concern. But then I tried to do the same from a Java class, and it failed too: java.sql.SQLException: ERROR: parser: parse error at or near "'My word ým'" at character 28 at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131) at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connec tion.java:505) I even tried to re-encode the sql statement into "Unicode", but that can be tricky and I'm not sure I got it right. Thank you for any feedback. P.S. In Java I only get the line references. In pgAdmin, however, it says this for character 'ý' (0xfd) when it is the last one: Invalid Unicode character sequence found (0xfd000a) This is actually an ISO-8859-1 character, not Unicode. Although it's not in English. If it's followed by 'm' for example, the error says: ... (0xfd6d00) In reality this character should map to (0x00fd), and it shouldn't matter what it's followed by. P.P.S. Just in case, where could I get the source for JDBC driver? It's not included in my cygwin distribution. I only have the compiled code. Thank you, r.