Thread: Another python patch -- minor

Another python patch -- minor

From
Greg Copeland
Date:
This fixes some text as well as enforces the use of "drop table cascade"
since we moved from an implicate to explicate implementation.

Please find attached the func.py patch.

Sorry these are not all one single patch.  I really hadn't planned on
doing all this...especially not tonight. ;)

Greg Copeland



Index: func.py
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/python/tutorial/func.py,v
retrieving revision 1.5
diff -u -r1.5 func.py
--- func.py    2000/10/02 03:46:24    1.5
+++ func.py    2002/08/08 03:47:04
@@ -9,7 +9,7 @@
 This module is designed for being imported from python prompt

 In order to run the samples included here, first create a connection
-using :                        cnx = advanced.DB(...)
+using :                        cnx = func.DB(...)

 The "..." should be replaced with whatever arguments you need to open an
 existing database.  Usually all you need is the name of the database and,
@@ -189,13 +189,13 @@
     print "DROP FUNCTION add_em(int4, int4)"
     print "DROP FUNCTION one()"
     print
-    print "DROP TABLE EMP"
+    print "DROP TABLE EMP CASCADE"
     pgcnx.query("DROP FUNCTION clean_EMP()")
     pgcnx.query("DROP FUNCTION high_pay()")
     pgcnx.query("DROP FUNCTION new_emp()")
     pgcnx.query("DROP FUNCTION add_em(int4, int4)")
     pgcnx.query("DROP FUNCTION one()")
-    pgcnx.query("DROP TABLE EMP")
+    pgcnx.query("DROP TABLE EMP CASCADE")

 # main demo function
 def demo(pgcnx):

Attachment

Re: Another python patch -- minor

From
Greg Copeland
Date:
Hmm.  That maybe.  I've yet to sit down and try to fully understand the
relations in the system tables.  I simply grep'd for pg_attribute and
added a check for "and attisdropped = 'f'".

In each case, I did attempt to run the modified queries to ensure they
still executed and compared the resulting output against the unmodified
queries, however, it doesn't mean I groked what it was really trying to
do.

If you do find corrections to be made, please let me know as I'd love to
know where, what, and why I messed up so I can learn from my mistakes.

Seems the only system tables ERD I have, I find rather hard to
read...guess that will be on my list of items to do today...find a good
ERD of the system tables.

Greg

On Wed, 2002-08-07 at 23:00, Christopher Kings-Lynne wrote:
> Hi Greg,
>
> You should be submitting all these patches to the pgsql-patches mailing
> list...
>
> I will look at your attisdropped patch a bit more carefully as I think some
> of the exclusions you've put in aren't necessary...
>
> Chris
>
> > -----Original Message-----
> > From: pgsql-hackers-owner@postgresql.org
> > [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Greg Copeland
> > Sent: Thursday, 8 August 2002 11:50 AM
> > To: PostgresSQL Hackers Mailing List
> > Subject: [HACKERS] Another python patch -- minor
> >
> >
> > This fixes some text as well as enforces the use of "drop table cascade"
> > since we moved from an implicate to explicate implementation.
> >
> > Please find attached the func.py patch.
> >
> > Sorry these are not all one single patch.  I really hadn't planned on
> > doing all this...especially not tonight. ;)
> >
> > Greg Copeland
> >
> >
> >
> >
>


Re: Another python patch -- minor

From
Greg Copeland
Date:
On Wed, 2002-08-07 at 23:00, Christopher Kings-Lynne wrote:
> Hi Greg,
>
> You should be submitting all these patches to the pgsql-patches mailing
> list...


Should I resubmit all my patches to that list or will they all be picked
up from here?

Greg


Re: Another python patch -- minor

From
Bruce Momjian
Date:
Picked up.  Thanks.

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

Greg Copeland wrote:

Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
> On Wed, 2002-08-07 at 23:00, Christopher Kings-Lynne wrote:
> > Hi Greg,
> > 
> > You should be submitting all these patches to the pgsql-patches mailing
> > list...
> 
> 
> Should I resubmit all my patches to that list or will they all be picked
> up from here?
> 
> Greg
> 
-- End of PGP section, PGP failed!

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: Another python patch -- minor

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:
http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

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


Greg Copeland wrote:

Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
> This fixes some text as well as enforces the use of "drop table cascade"
> since we moved from an implicate to explicate implementation.
> 
> Please find attached the func.py patch.
> 
> Sorry these are not all one single patch.  I really hadn't planned on
> doing all this...especially not tonight. ;)
> 
> Greg Copeland
> 
> 
> 

[ text/x-patch is unsupported, treating like TEXT/PLAIN ]

> Index: func.py
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/python/tutorial/func.py,v
> retrieving revision 1.5
> diff -u -r1.5 func.py
> --- func.py    2000/10/02 03:46:24    1.5
> +++ func.py    2002/08/08 03:47:04
> @@ -9,7 +9,7 @@
>  This module is designed for being imported from python prompt
>  
>  In order to run the samples included here, first create a connection
> -using :                        cnx = advanced.DB(...)
> +using :                        cnx = func.DB(...)
>  
>  The "..." should be replaced with whatever arguments you need to open an
>  existing database.  Usually all you need is the name of the database and,
> @@ -189,13 +189,13 @@
>      print "DROP FUNCTION add_em(int4, int4)"
>      print "DROP FUNCTION one()"
>      print
> -    print "DROP TABLE EMP"
> +    print "DROP TABLE EMP CASCADE"
>      pgcnx.query("DROP FUNCTION clean_EMP()")
>      pgcnx.query("DROP FUNCTION high_pay()")
>      pgcnx.query("DROP FUNCTION new_emp()")
>      pgcnx.query("DROP FUNCTION add_em(int4, int4)")
>      pgcnx.query("DROP FUNCTION one()")
> -    pgcnx.query("DROP TABLE EMP")
> +    pgcnx.query("DROP TABLE EMP CASCADE")
>  
>  # main demo function
>  def demo(pgcnx):
-- End of PGP section, PGP failed!

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: Another python patch -- minor

From
Bruce Momjian
Date:
Patch applied.  Thanks.

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



Greg Copeland wrote:

Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
> This fixes some text as well as enforces the use of "drop table cascade"
> since we moved from an implicate to explicate implementation.
> 
> Please find attached the func.py patch.
> 
> Sorry these are not all one single patch.  I really hadn't planned on
> doing all this...especially not tonight. ;)
> 
> Greg Copeland
> 
> 
> 

[ text/x-patch is unsupported, treating like TEXT/PLAIN ]

> Index: func.py
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/python/tutorial/func.py,v
> retrieving revision 1.5
> diff -u -r1.5 func.py
> --- func.py    2000/10/02 03:46:24    1.5
> +++ func.py    2002/08/08 03:47:04
> @@ -9,7 +9,7 @@
>  This module is designed for being imported from python prompt
>  
>  In order to run the samples included here, first create a connection
> -using :                        cnx = advanced.DB(...)
> +using :                        cnx = func.DB(...)
>  
>  The "..." should be replaced with whatever arguments you need to open an
>  existing database.  Usually all you need is the name of the database and,
> @@ -189,13 +189,13 @@
>      print "DROP FUNCTION add_em(int4, int4)"
>      print "DROP FUNCTION one()"
>      print
> -    print "DROP TABLE EMP"
> +    print "DROP TABLE EMP CASCADE"
>      pgcnx.query("DROP FUNCTION clean_EMP()")
>      pgcnx.query("DROP FUNCTION high_pay()")
>      pgcnx.query("DROP FUNCTION new_emp()")
>      pgcnx.query("DROP FUNCTION add_em(int4, int4)")
>      pgcnx.query("DROP FUNCTION one()")
> -    pgcnx.query("DROP TABLE EMP")
> +    pgcnx.query("DROP TABLE EMP CASCADE")
>  
>  # main demo function
>  def demo(pgcnx):
-- End of PGP section, PGP failed!

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073