-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Apr 14, 2008 at 4:44 PM, kenneth d'souza wrote: > > Hi Brendan, > Your observation is correct. > > The indentation is deliberate. The reason is that the (result7,i,3) starts > with the word "FOREIGN KEY ". I am using the details that follow after this > blurb. > All other keywords which are searched in usingpos = strstr(indexdef, " > KEYWORD ") , the KEYWORD are embedded somewhere in between in the output. > Hence indentation given is that of four spaces considering the final output > that it is desired. >
Sorry Kenneth, I didn't quite follow your explanation. How does the position of "FOREIGN KEY " affect the indentation at the beginning of the footer? I'm getting the following output with HEAD: """ postgres=# create table foo (a int primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo" CREATE TABLE postgres=# create table bar (a int primary key, foo int not null references foo); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "bar_pkey" for table "bar" CREATE TABLE postgres=# alter table foo add bar int not null references bar; ALTER TABLE postgres=# \d foo Table "public.foo" Column | Type | Modifiers - --------+---------+----------- a | integer | not null Indexes: "foo_pkey" PRIMARY KEY, btree (a) Foreign-key constraints: "foo_bar_fkey" FOREIGN KEY (bar) REFERENCES bar(a) Referenced by: "bar_foo_fkey" IN bar FOREIGN KEY (foo) REFERENCES foo(a) """ Note the indent on the constraint listed under "Referenced by" is only two spaces, instead of the usual four shown under "Indexes" and "Foreign-key constraints". The attached patch corrects the indent to the standard four spaces. Cheers, BJ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: http://getfiregpg.org iD8DBQFIAz0H5YBsbHkuyV0RApFyAJ9PZNbS2p/SO0rNdKSwAjFMxWd0dwCfWd2z GMhn6Gt3ZAwelpnirDaa+1U= =Dbuo -----END PGP SIGNATURE-----
*** src/bin/psql/describe.c --- src/bin/psql/describe.c *************** *** 1373,1379 **** describeOneTableDetails(const char *schemaname, footers[count_footers++] = pg_strdup(buf.data); for (i = 0; i < referencedby_count; i++) { ! printfPQExpBuffer(&buf, _(" \"%s\" IN %s %s"), PQgetvalue(result6, i, 0), PQgetvalue(result6, i, 1), PQgetvalue(result6, i, 2)); --- 1373,1379 ---- footers[count_footers++] = pg_strdup(buf.data); for (i = 0; i < referencedby_count; i++) { ! printfPQExpBuffer(&buf, _(" \"%s\" IN %s %s"), PQgetvalue(result6, i, 0), PQgetvalue(result6, i, 1), PQgetvalue(result6, i, 2));
-- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches