Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpDgt-0003wr-Ey for pgsql-admin@arkaria.postgresql.org; Sun, 21 Jul 2019 15:23:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpDgq-00016a-TS for pgsql-admin@arkaria.postgresql.org; Sun, 21 Jul 2019 15:23:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpDgq-00016T-KB for pgsql-admin@lists.postgresql.org; Sun, 21 Jul 2019 15:23:56 +0000 Received: from sonic302-2.consmr.mail.bf2.yahoo.com ([74.6.135.41]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpDgo-0004Sp-7H for pgsql-admin@lists.postgresql.org; Sun, 21 Jul 2019 15:23:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1563722631; bh=06v6GzFjakzhqPd6I92HZSGIu5J2vxH+GieMKXP9ruA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=XpyY6KkENkV1v0g5VWVOorwSklTbOSYoEoyZLRpWYYHsweAuN8uXPvj+7MV3ZC3ODj6ofsAnuhKFEKSdqQzDxzPC3D6hBZed98gGhR1uhE0FmKCblhQ27KrSWmgXmzV1CEjpR4UX5RUR3/bgazhjHeHoKXdgEj69QiFSCS7ucpunp6oTpIRLMx4zDqMO8NYC8I1FUuM4UYbPSa7Oyt6XdtsfTsIKn6hYGNRc36l+hgKcSfA5G5g9Y1sXPQSDCcGbp1VMj4vqcQtOGHIeOTuuTf16SvgBt7+gy9HqadjbUWWI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EpefkfE9rgtUuPH94He.BidMsLv0eItxku9CqI_s81 OpCYZr26r3ZPJz6A8AVR6jEkSrxAlTvCI5bxFo3qtSwG92yMIIKNUFQZIkwpwctZQc8yGgYXIzpK TO_D69DsrW_zjvqKjKSROoOeQXgdmR2bgaOzvmPA7ZmAn6vSnjjNZPVsHqhfjRM8oX1SF9JaAAO_ w79QCed.nmtG9tg8d1I6lm3s2fVUjw8W7YBPvnzWnCVwPbh2h67nK6_nBBgG_Fme8DqRpdPANqDA FM90a2I1QvXyrGe5U7rKEfTUtPBEVTQd6ffmm4Q-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Sun, 21 Jul 2019 15:23:51 +0000 Date: Sun, 21 Jul 2019 15:23:48 +0000 (UTC) From: Karen Goh To: Ron Cc: pgsql-admin@lists.postgresql.org Message-ID: <927283546.2681887.1563722628862@mail.yahoo.com> In-Reply-To: <75125c45-0fed-e5f1-50f0-9646db20dde6@gmail.com> References: <820008379.2579287.1563670685484@mail.yahoo.com> <5CE41E80-274A-44DA-9553-E2DCA260F751@jakobs.com> <385857992.2643116.1563717238725@mail.yahoo.com> <923fb3b1-90e9-e0b5-bc5b-d896128c3f28@gmail.com> <1745586001.2633224.1563719075867@mail.yahoo.com> <905425626.2686338.1563721213121@mail.yahoo.com> <2030754658.2646264.1563721831668@mail.yahoo.com> <75125c45-0fed-e5f1-50f0-9646db20dde6@gmail.com> Subject: Re: How do I alter an existing column and add a foreign key which is a Primary key to a table? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2681886_1367806405.1563722628861" Content-Length: 3529 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_2681886_1367806405.1563722628861 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =20 On Sunday, July 21, 2019, 11:13:58 PM GMT+8, Ron = wrote: On 7/21/19 10:10 AM, Karen Goh wrote: > > On Sunday, July 21, 2019, 11:06:16 PM GMT+8, David G. Johnston > wrote: > > > On Sunday, July 21, 2019, Karen Goh wrote: > > > Is there a way for me to generate an entity table diagram vis pgAdmin4 or > PSQL ? > > > Just write the 5 or so tables out in a somewhat compressed format. Psql > doesn=E2=80=99t and I don=E2=80=99t know about pgadmin > > Here is a compressed format : > > s_tutor > -------- > zipcode(text) > tutor_id (I just checked this is becomes a 'serial id ?' based on the > generated sql > > ALTER TABLE public.s_tutor ALTER COLUMN tutor_id ADD GENERATED BY DEFAULT > AS IDENTITY ( > SEQUENCE NAME public.tutor_strtutorid_seq > START WITH 1 > INCREMENT BY 1 > NO MINVALUE > NO MAXVALUE > CACHE 1 > ); > > tutor_subject > ---------------- > tutor_id > subject_Names select s_tutor.zipcode from s_tutor, tutor_subject where s_tutor.tutor_id =3D tutor_subject.tutor_id and tutor_subject.subject_names =3D'Angela Merkel' Hi Ron, Could you explain why you select s_tutor.zipcode from tutor_subject since t= here is no zipcode inside tutor_subject? Perhaps my reasoning is wrong and I really want to have your expert view.= =20 --=20 Angular momentum makes the world go 'round. =20 ------=_Part_2681886_1367806405.1563722628861 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable





On Sunday, July 21, 2019, 11:13:58= PM GMT+8, Ron <ronljohnsonjr@gmail.com> wrote:


On 7/21/19= 10:10 AM, Karen Goh wrote:

>
> On Sunday, July 21, 2019, 1= 1:06:16 PM GMT+8, David G. Johnston
> <david.g.johnston@gmail.com&= gt; wrote:
>
>
> On Sunday, July 21, 2019, Karen Goh <= karenworld@yahoo.com> wrote:
>
>
> Is there a way for = me to generate an entity table diagram vis pgAdmin4 or
> PSQL ?
&g= t;
>
> Just write the 5 or so tables out in a somewhat compress= ed format. Psql
> doesn=E2=80=99t and I don=E2=80=99t know about pgad= min
>
> Here is a compressed format :
>
> s_tutor> --------
> zipcode(text)
> tutor_id (I just checked this= is becomes a 'serial id ?' based on the
> generated sql
&= gt;
> ALTER TABLE public.s_tutor ALTER COLUMN tutor_id ADD GENERATED = BY DEFAULT
> AS IDENTITY (
> SEQUENCE NAME public.tutor_strtuto= rid_seq
> START WITH 1
> INCREMENT BY 1
> NO MINVALUE
= > NO MAXVALUE
> CACHE 1
> );
>
> tutor_subject> ----------------
> tutor_id
> subject_Names


s= elect s_tutor.zipcode
from s_tutor, tutor_subject
where s_tutor.tutor= _id =3D tutor_subject.tutor_id
and tutor_subject.subject_names =3D'= ;Angela Merkel'

Hi Ron,

Could you explain why you select = s_tutor.zipcode from tutor_subject since there is no zipcode inside tutor_s= ubject?

Perhaps my reasoning is wrong and I really want to have your= expert view.


--
Angular momentum makes the world go 'r= ound.



=20 ------=_Part_2681886_1367806405.1563722628861--