1 |
6daefa8c
|
Petr Lukašík
|
phpPgAdmin Frequently Asked Questions
|
2 |
|
|
-------------------------------------
|
3 |
|
|
|
4 |
|
|
Installation errors
|
5 |
|
|
-------------------
|
6 |
|
|
|
7 |
|
|
Q: I've installed phpPgAdmin but when I try to use it I get an error message
|
8 |
|
|
telling me that I have not compiled proper database support into my
|
9 |
|
|
PHP installation.
|
10 |
|
|
|
11 |
|
|
A: This means that you have not properly compiled PostgreSQL support into
|
12 |
|
|
your PHP. The correct configure flag to use is '--with-pgsql'. Read the
|
13 |
|
|
PHP manual and website for more help with this.
|
14 |
|
|
|
15 |
|
|
PostgreSQL support can be also compiled into PHP as a dynamic extension,
|
16 |
|
|
so if you have precompiled version (Linux RPM, or Windows binary), there
|
17 |
|
|
are still chances, that only thing you should do is to enable loading it
|
18 |
|
|
automagically.
|
19 |
|
|
|
20 |
|
|
It can be done by editing your php.ini file (under Windows, usually in
|
21 |
|
|
C:\WINDOWS or C:\WINNT, under Linux /etc/php.ini) and uncommenting this
|
22 |
|
|
line:
|
23 |
|
|
|
24 |
|
|
;extension=php_pgsql.dll ;under Windows
|
25 |
|
|
;extension=pgsql.so ;under Linux
|
26 |
|
|
|
27 |
|
|
so it would look like that:
|
28 |
|
|
|
29 |
|
|
extension=php_pgsql.dll ;under Windows
|
30 |
|
|
extension=pgsql.so ;under Linux
|
31 |
|
|
|
32 |
|
|
In Linux distributions based on Red Hat or Fedora, PHP extensions are
|
33 |
|
|
automatically configured in /etc/php.d/pgsql.ini, simply install the
|
34 |
|
|
php-pgsql package.
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
Q: I get a warning like this when using phpPgAdmin on Windows:
|
38 |
|
|
|
39 |
|
|
"Warning: session_start() [function.session-start]:
|
40 |
|
|
open(/tmp\sess_5a401ef1e67fb7a176a95236116fe348, O_RDWR) failed"
|
41 |
|
|
|
42 |
|
|
A: You need to edit your PHP.INI file (usually in c:\windows) and change this
|
43 |
|
|
line:
|
44 |
|
|
|
45 |
|
|
session.save_path = "/tmp"
|
46 |
|
|
|
47 |
|
|
to:
|
48 |
|
|
|
49 |
|
|
session.save_path = "c:\windows\temp"
|
50 |
|
|
|
51 |
|
|
And make sure that the folder c:\windows\temp actually exists.
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
Login errors
|
55 |
|
|
------------
|
56 |
|
|
|
57 |
|
|
Q: I always get "Login failed" even though I'm _sure_ I'm using the right
|
58 |
|
|
username and password.
|
59 |
|
|
|
60 |
|
|
A: Check the PostgreSQL log on your server, it will give the exact reason
|
61 |
|
|
why the login is failing. Edit the pg_hba.conf file in your PostgreSQL
|
62 |
|
|
data dir and make sure you have enabled access to the server properly.
|
63 |
|
|
|
64 |
|
|
If you've installed phpPgAdmin on a computer different from the PostgreSQL
|
65 |
|
|
server, another likely reason may be that you have not started the
|
66 |
|
|
PostgreSQL server with TCP/IP sockets enabled. To enable this, edit your
|
67 |
|
|
postgresql.conf file and change this line:
|
68 |
|
|
|
69 |
|
|
#tcpip_socket = false
|
70 |
|
|
|
71 |
|
|
to:
|
72 |
|
|
|
73 |
|
|
tcpip_socket = true
|
74 |
|
|
|
75 |
|
|
and then restart PostgreSQL.
|
76 |
|
|
|
77 |
|
|
Q: For some users I get a "Login disallowed for security" message.
|
78 |
|
|
|
79 |
|
|
A: Logins via phpPgAdmin with no password or certain usernames (pgsql,
|
80 |
|
|
postgres, root, administrator) are denied by default. Before changing this
|
81 |
|
|
behaviour (setting $conf['extra_login_security'] to false in the
|
82 |
|
|
config.inc.php file) please read the PostgreSQL documentation about client
|
83 |
|
|
authentication and understand how to change PostgreSQL's pg_hba.conf to
|
84 |
|
|
enable passworded local connections.
|
85 |
|
|
|
86 |
|
|
Q: I can use any password to log in!
|
87 |
|
|
|
88 |
|
|
A: PostgreSQL, by default, runs in trust mode. That means that it doesn't
|
89 |
|
|
ask for passwords for local connections. We highly recommend that you
|
90 |
|
|
edit your pg_hba.conf file, and change the login type to 'md5'. Note
|
91 |
|
|
that if you change the 'local' login type to 'md5', then you might need
|
92 |
|
|
to enter a password to start PostgreSQL. Get around this by using a
|
93 |
|
|
.pgpass file - explained in the PostgreSQL documentation.
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
Other errors
|
97 |
|
|
------------
|
98 |
|
|
|
99 |
|
|
Q: When I enter non-ASCII data into the database via a form, it's inserted
|
100 |
|
|
as hexadecimal or Ӓ format!
|
101 |
|
|
|
102 |
|
|
A: You have not created your database in the correct encoding. This problem
|
103 |
|
|
will occur when you try to enter an umlaut into an SQL_ASCII database, or
|
104 |
|
|
SJIS Japanese into an EUC-JP database, etc.
|
105 |
|
|
|
106 |
|
|
Q: When I drop and re-create a table with the same name, it fails.
|
107 |
|
|
|
108 |
|
|
A: You need to drop the sequence attached to the SERIAL column of the table
|
109 |
|
|
as well. PostgreSQL 7.3 and above do this automatically. If you have
|
110 |
|
|
upgraded to PostgreSQL 7.3 from an earlier version, you need to run the
|
111 |
|
|
contrib/adddepend script to record all dependencies.
|
112 |
|
|
|
113 |
|
|
Q: When browsing a table, the 'edit' and 'delete' links do not appear.
|
114 |
|
|
|
115 |
|
|
A: In order, phpPgAdmin will prefer the following as unique row identifiers:
|
116 |
|
|
|
117 |
|
|
1. Primary keys
|
118 |
|
|
2. Unique keys (cannot be parital or expressional indexes)
|
119 |
|
|
3. OID column (will require a sequential scan to update, unless you
|
120 |
|
|
index the OID column)
|
121 |
|
|
|
122 |
|
|
Furthermore, any NULL values in the unique index will mean that that row
|
123 |
|
|
will be uneditable. Also, since OIDs can become duplicated in a table,
|
124 |
|
|
phpPgAdmin will alter the row, and then check to ensure that exactly one
|
125 |
|
|
row has been modified - otherwise rollback will occur.
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
Questions on dumps
|
129 |
|
|
------------------
|
130 |
|
|
|
131 |
|
|
Q: What happened to the database dump feature?
|
132 |
|
|
|
133 |
|
|
A: You need to configure phpPgAdmin (in the config.inc.php file) to point
|
134 |
|
|
to the location of the pg_dump and pg_dumpall utilities on your server.
|
135 |
|
|
Once you have done that, the database export feature will appear.
|
136 |
|
|
|
137 |
|
|
Q: I would like to use the pg_dump integration for database and table
|
138 |
|
|
dumps on Windows. How do I get pg_dump.exe on Windows?
|
139 |
|
|
|
140 |
|
|
A: To get the pg_dump utilities on Windows, you need to install PostgreSQL 8.0
|
141 |
|
|
for Windows. It is available for download at
|
142 |
|
|
http://www.postgresql.org/ftp/win32/ .
|
143 |
|
|
Once you have installed that, set the pg_dump and pg_dumpall locations
|
144 |
|
|
in the config.inc.php file to
|
145 |
|
|
'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dump.exe' and
|
146 |
|
|
'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dumpall.exe', or wherever you
|
147 |
|
|
installed them.
|
148 |
|
|
|
149 |
|
|
Q: Why can't I reload the SQL script I dumped in the SQL window?
|
150 |
|
|
|
151 |
|
|
A: The following limitations currently exist in SQL script execution:
|
152 |
|
|
|
153 |
|
|
* Only uploaded SQL scripts can contain COPY commands and for
|
154 |
|
|
this to work, you must have PHP 4.2 or higher.
|
155 |
|
|
|
156 |
|
|
* 'psql' commands such as '\connect' will not work at all.
|
157 |
|
|
|
158 |
|
|
* Multiline SQL statements will not work, eg:
|
159 |
|
|
|
160 |
|
|
CREATE TABLE example (
|
161 |
|
|
a INTEGER
|
162 |
|
|
);
|
163 |
|
|
|
164 |
|
|
* You cannot change the current database or current user during
|
165 |
|
|
the execution of the script.
|
166 |
|
|
|
167 |
|
|
We do intend to work on some of these limitations in the future, but
|
168 |
|
|
some of them are PostgreSQL restrictions and we recommend using the
|
169 |
|
|
'psql' utility to restore your full SQL dumps.
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
Other questions
|
173 |
|
|
---------------
|
174 |
|
|
|
175 |
|
|
Q: When inserting a row, what is does the 'Value' or 'Expression' box mean?
|
176 |
|
|
|
177 |
|
|
A: Choosing 'Expression' means that you can use functions, operators, other
|
178 |
|
|
field names, etc. in your value - you need to properly quote any literal
|
179 |
|
|
values yourself. 'Value' on the other hand, means that no matter what you
|
180 |
|
|
enter as the value, it will be inserted as-is into the database.
|
181 |
|
|
|
182 |
|
|
Q: Why is there never any information on the 'Info' page of a table?
|
183 |
|
|
|
184 |
|
|
A: The Info page will show you what other tables have foreign keys to the
|
185 |
|
|
current table and some data from the PostgreSQL statistics collector.
|
186 |
|
|
The stats collector is not enabled by default in PostgreSQL. To enable
|
187 |
|
|
it, look in your postgresql.conf file for the stats_* options. Just
|
188 |
|
|
make them all 'true' and restart PostgreSQL.
|
189 |
|
|
|
190 |
|
|
Q: Why can't I download data from queries executed in the SQL window?
|
191 |
|
|
|
192 |
|
|
A: You need to check the 'Paginate results' option to allow downloads.
|
193 |
|
|
|
194 |
|
|
Q: I would like to help out with the development of phpPgAdmin. How should I
|
195 |
|
|
proceed?
|
196 |
|
|
|
197 |
|
|
A: We really would like your help! Please read the DEVELOPERS and TRANSLATORS
|
198 |
|
|
files.
|