Hi,
Peter Eisentraut wrote:
> For some experiments I wanted to run the regression tests using a different
> database (possibly using pg_regress --dbname=), but the name "regression" is
> hardcoded in a few places. It's trivial to fix, see attached patch. Quick
> explanation: The fact that psql's \z prints the database name has always been
> an inconsistency, so it's good to get rid of anyway. The majority of the
> diff in prepare.out is whitespace differences. Objections?
Looks good from here, passed the regressions on my (pretty standard
debian unstable) box.
However, there were some issues applying the patch, probably related to
git's diff format (patch version 2.5.9):
patch: **** malformed patch at line 255: diff -ur
../cvs-pgsql/src/test/regress/sql/prepare.sql
./src/test/regress/sql/prepare.sql
For those who care, I've added the same patch in context diff format and
modulo whitespaces. :-)
+1 for the change per se.
Regards
Markus
*** doc/src/sgml/ref/grant.sgml old
--- doc/src/sgml/ref/grant.sgml new
***************
*** 419,425 ****
to obtain information about existing privileges, for example:
<programlisting>
=> \z mytable
! Access privileges for database "lusitania"
Schema | Name | Type | Access privileges
--------+---------+-------+----------------------
public | mytable | table | miriam=arwdxt/miriam
--- 419,425 ----
to obtain information about existing privileges, for example:
<programlisting>
=> \z mytable
! Access privileges
Schema | Name | Type | Access privileges
--------+---------+-------+----------------------
public | mytable | table | miriam=arwdxt/miriam
*** src/bin/psql/describe.c old
--- src/bin/psql/describe.c new
***************
*** 544,551 ****
}
myopt.nullPrint = NULL;
! printfPQExpBuffer(&buf, _("Access privileges for database \"%s\""),
! PQdb(pset.db));
myopt.title = buf.data;
myopt.trans_headers = true;
myopt.trans_columns = trans_columns;
--- 544,550 ----
}
myopt.nullPrint = NULL;
! printfPQExpBuffer(&buf, _("Access privileges"));
myopt.title = buf.data;
myopt.trans_headers = true;
myopt.trans_columns = trans_columns;
*** src/test/regress/expected/dependency.out old
--- src/test/regress/expected/dependency.out new
***************
*** 68,74 ****
GRANT ALL ON deptest1 TO regression_user2;
RESET SESSION AUTHORIZATION;
\z deptest1
! Access privileges for database "regression"
Schema | Name | Type | Access privileges
--------+----------+-------+------------------------------------------------
public | deptest1 | table | regression_user0=arwdxt/regression_user0
--- 68,74 ----
GRANT ALL ON deptest1 TO regression_user2;
RESET SESSION AUTHORIZATION;
\z deptest1
! Access privileges
Schema | Name | Type | Access privileges
--------+----------+-------+------------------------------------------------
public | deptest1 | table | regression_user0=arwdxt/regression_user0
***************
*** 79,85 ****
DROP OWNED BY regression_user1;
-- all grants revoked
\z deptest1
! Access privileges for database "regression"
Schema | Name | Type | Access privileges
--------+----------+-------+------------------------------------------
public | deptest1 | table | regression_user0=arwdxt/regression_user0
--- 79,85 ----
DROP OWNED BY regression_user1;
-- all grants revoked
\z deptest1
! Access privileges
Schema | Name | Type | Access privileges
--------+----------+-------+------------------------------------------
public | deptest1 | table | regression_user0=arwdxt/regression_user0
*** src/test/regress/expected/prepare.out old
--- src/test/regress/expected/prepare.out new
***************
*** 58,67 ****
PREPARE q2(text) AS
SELECT datname, datistemplate, datallowconn
FROM pg_database WHERE datname = $1;
! EXECUTE q2('regression');
datname | datistemplate | datallowconn
! ------------+---------------+--------------
! regression | f | t
(1 row)
PREPARE q3(text, int, float, boolean, oid, smallint) AS
--- 58,67 ----
PREPARE q2(text) AS
SELECT datname, datistemplate, datallowconn
FROM pg_database WHERE datname = $1;
! EXECUTE q2('postgres');
datname | datistemplate | datallowconn
! ----------+---------------+--------------
! postgres | f | t
(1 row)
PREPARE q3(text, int, float, boolean, oid, smallint) AS
*** src/test/regress/expected/privileges.out old
--- src/test/regress/expected/privileges.out new
***************
*** 582,588 ****
(1 row)
-- clean up
! \c regression
DROP FUNCTION testfunc2(int);
DROP FUNCTION testfunc4(boolean);
DROP VIEW atestv1;
--- 582,588 ----
(1 row)
-- clean up
! \c
DROP FUNCTION testfunc2(int);
DROP FUNCTION testfunc4(boolean);
DROP VIEW atestv1;
*** src/test/regress/expected/temp.out old
--- src/test/regress/expected/temp.out new
***************
*** 42,48 ****
DROP TABLE temptest;
-- test temp table deletion
CREATE TEMP TABLE temptest(col int);
! \c regression
SELECT * FROM temptest;
ERROR: relation "temptest" does not exist
-- Test ON COMMIT DELETE ROWS
--- 42,48 ----
DROP TABLE temptest;
-- test temp table deletion
CREATE TEMP TABLE temptest(col int);
! \c
SELECT * FROM temptest;
ERROR: relation "temptest" does not exist
-- Test ON COMMIT DELETE ROWS
*** src/test/regress/sql/prepare.sql old
--- src/test/regress/sql/prepare.sql new
***************
*** 34,40 ****
SELECT datname, datistemplate, datallowconn
FROM pg_database WHERE datname = $1;
! EXECUTE q2('regression');
PREPARE q3(text, int, float, boolean, oid, smallint) AS
SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
--- 34,40 ----
SELECT datname, datistemplate, datallowconn
FROM pg_database WHERE datname = $1;
! EXECUTE q2('postgres');
PREPARE q3(text, int, float, boolean, oid, smallint) AS
SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
*** src/test/regress/sql/privileges.sql old
--- src/test/regress/sql/privileges.sql new
***************
*** 334,340 ****
-- clean up
! \c regression
DROP FUNCTION testfunc2(int);
DROP FUNCTION testfunc4(boolean);
--- 334,340 ----
-- clean up
! \c
DROP FUNCTION testfunc2(int);
DROP FUNCTION testfunc4(boolean);
*** src/test/regress/sql/temp.sql old
--- src/test/regress/sql/temp.sql new
***************
*** 47,53 ****
CREATE TEMP TABLE temptest(col int);
! \c regression
SELECT * FROM temptest;
--- 47,53 ----
CREATE TEMP TABLE temptest(col int);
! \c
SELECT * FROM temptest;