Re: Reference by output in : \d <table_name>

Lists: pgsql-patches
From: kenneth d'souza <kd_souza(at)hotmail(dot)com>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Reference by output in : \d <table_name>
Date: 2008-03-03 04:19:30
Message-ID: BAY116-W248FC9509F6A2C08F8FB11ED170@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


With reference to the post http://archives.postgresql.org/pgsql-patches/2008-02/msg00104.phpand as stated by -hackers and -patchers, I am submitting the diff -c output as an attachment. Thanks, Kenneth
_________________________________________________________________
Tried the new MSN Messenger? It’s cool! Download now.
http://messenger.msn.com/Download/Default.aspx?mkt=en-in

Attachment Content-Type Size
describe.patch text/plain 3.6 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-03-03 21:13:04
Message-ID: 200803032113.m23LD5606679@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

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

kenneth d'souza wrote:
>
> With reference to the post http://archives.postgresql.org/pgsql-patches/2008-02/msg00104.phpand as stated by -hackers and -patchers, I am submitting the diff -c output as an attachment. Thanks, Kenneth
> _________________________________________________________________
> Tried the new MSN Messenger? It?s cool! Download now.
> http://messenger.msn.com/Download/Default.aspx?mkt=en-in
[ Attachment, skipping... ]

>
> --
> Sent via pgsql-patches mailing list (pgsql-patches(at)postgresql(dot)org)
> To make changes to your Subscription:
> http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgsql-patches

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-03-30 17:50:45
Message-ID: 25631.1206899445@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

"kenneth d'souza" <kd_souza(at)hotmail(dot)com> writes:
> With reference to the post http://archives.postgresql.org/pgsql-patches/2008-02/msg00104.phpand as stated by -hackers and -patchers, I am submitting the diff -c output as an attachment. Thanks, Kenneth

Applied with some revisions.

regards, tom lane


From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-12 06:49:12
Message-ID: 37ed240d0804112349g79c07b56p7d68d4e219ab72c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Mon, Mar 31, 2008 at 3:50 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "kenneth d'souza" <kd_souza(at)hotmail(dot)com> writes:
> > With reference to the post http://archives.postgresql.org/pgsql-patches/2008-02/msg00104.phpand as stated by -hackers and -patchers, I am submitting the diff -c output as an attachment. Thanks, Kenneth
>
> Applied with some revisions.
>

While working on my printTable patch, I noticed that this patch only
has an indent of two spaces for incoming foreign keys, while all the
other table footers have an indent of four spaces.

Was this deliberate? And if so, why the change in indentation for
this particular listing?

Cheers,
BJ


From: kenneth d'souza <kd_souza(at)hotmail(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-14 06:44:00
Message-ID: BAY116-W90C43C508C39471C54C38EDE80@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


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.

Thanks,
Kenneth

_________________________________________________________________
Tried the new MSN Messenger? It’s cool! Download now.
http://messenger.msn.com/Download/Default.aspx?mkt=en-in


From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-14 11:16:31
Message-ID: 37ed240d0804140416h70fd7885vfc2194d3b2b823d1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

-----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-----

Attachment Content-Type Size
referenced-by-indent.diff text/plain 715 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brendan Jurd" <direvus(at)gmail(dot)com>
Cc: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-14 13:42:10
Message-ID: 1243.1208180530@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

"Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> 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 changed that patch around a bit while applying it, and very possibly
fat-fingered the indentation --- I don't recall having explicitly
compared it to the other cases. It surely should be consistent with
everything else.

regards, tom lane


From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-14 13:56:18
Message-ID: 37ed240d0804140656u4c1f0af4g31f6d2d1863b73bf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Apr 14, 2008 at 11:42 PM, Tom Lane wrote:
> "Brendan Jurd" writes:
> > 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 changed that patch around a bit while applying it, and very possibly
> fat-fingered the indentation

FWIW, I think the deviant indentation was present in the original
patch submitted by Kenneth. I compared your commit with the patch,
and the initial two-space indent is clearly there in both diffs.

> --- I don't recall having explicitly
> compared it to the other cases. It surely should be consistent with
> everything else.
>

Yeah, that's what I figured. The patch I attached to my previous
email should fix it up.

Cheers,
BJ

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: http://getfiregpg.org

iD8DBQFIA2J55YBsbHkuyV0RAjpxAKCy+pzCV8h88k5PcdwD8ik86Ka1PACffVOO
K2rItDy0yWlvTxZpArpXU0o=
=vLyi
-----END PGP SIGNATURE-----


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "kenneth d'souza" <kd_souza(at)hotmail(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-14 15:04:35
Message-ID: 20080414150435.GG4541@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Brendan Jurd escribió:

> Yeah, that's what I figured. The patch I attached to my previous
> email should fix it up.

Applied, thanks.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: kenneth d'souza <kd_souza(at)hotmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-16 12:00:40
Message-ID: BAY116-W44BCFBC36E9487BD9FAE8CEDEA0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Hi Brendan,

I thought you were referring to the spaces sourrounding the word "FOREIGN KEY" on the last line and hence my explaination was out of place.I am glad that you have corrected the indentation to 4 spaces. Those were unintentional at 2 spaces from myside.
However,Why does the word "FOREIGN KEY" appear in the last line of your output. My original patch had the output like this.
Referenced by: "bar_foo_fkey" IN public.bar(foo) REFERENCES foo(a)
The keyword "FOREIGN KEY" was removed by me as it would further cause a confusion.
Secondly, since the table foo is altered with an addition of a new column "bar", it doesn't display in your output. Please double check.
My output is looking like this:
testdb=# \d foo Table "public.foo" Column | Type | Modifiers--------+---------+----------- a | integer | not null bar | integer | not null /* Brendan--this line is missing in your output */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 public.bar(foo) REFERENCES foo(a)
/* please ignore the 2 space indent, I am still using my orignal patch. I will correct it later */
Thanks,Kenneth> Date: Mon, 14 Apr 2008 11:04:35 -0400> From: alvherre(at)commandprompt(dot)com> To: direvus(at)gmail(dot)com> CC: tgl(at)sss(dot)pgh(dot)pa(dot)us; kd_souza(at)hotmail(dot)com; pgsql-patches(at)postgresql(dot)org> Subject: Re: [PATCHES] Reference by output in : \d <table_name>> > Brendan Jurd escribió:> > > Yeah, that's what I figured. The patch I attached to my previous> > email should fix it up.> > Applied, thanks.> > -- > Alvaro Herrera http://www.CommandPrompt.com/> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
_________________________________________________________________
Fashion Channel : Want to know what’s the latest in the fashion world ? You have it all here on MSN Fashion.
http://lifestyle.in.msn.com/


From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "kenneth d'souza" <kd_souza(at)hotmail(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Reference by output in : \d <table_name>
Date: 2008-04-16 16:42:25
Message-ID: 37ed240d0804160942x22dd8da4y7776ee6484d9ebf4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Apr 16, 2008 at 10:00 PM, kenneth d'souza wrote:
> However,Why does the word "FOREIGN KEY" appear in the last line of your
> output. My original patch had the output like this.
> Referenced by:
> "bar_foo_fkey" IN public.bar(foo) REFERENCES foo(a)
> The keyword "FOREIGN KEY" was removed by me as it would further cause a
> confusion.
>

Hi Kenneth,

Tom reinstated the "FOREIGN KEY" part of the definition when he
committed your patch. I think it's fine with "FOREIGN KEY" left in
there; I don't find it confusing. I actually think it makes the line
more descriptive and obvious.

> Secondly, since the table foo is altered with an addition of a new column
> "bar", it doesn't display in your output. Please double check.
>

You're right; it was just a copy-paste error I made when I was
composing my email. The actual output from psql shows all columns as
expected.

Cheers,
BJ
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: http://getfiregpg.org

iD8DBQFIBixv5YBsbHkuyV0RArJSAJ0eDes2V0nwlgQuNE0GjJxwW4Ey8gCgiWTw
UjSjF8EJaTDSTQnkTfgSasY=
=xdOl
-----END PGP SIGNATURE-----