Thread: patch for examples

patch for examples

From
"Permaine Cheung"
Date:
There are a few typos in the examples under src/interfaces.
The following is a small patch to fix them.

Permaine
Red Hat Canada Limited


Index: libpgeasy/examples/pginsert.c
===================================================================
RCS file:
/projects/cvsroot/pgsql/src/interfaces/libpgeasy/examples/pginsert.c,v
retrieving revision 1.7
diff -r1.7 pginsert.c
44c44
<    achar16 char16, \
---
>    achar16 char(16), \
Index: libpgeasy/examples/pgnulltest.c
===================================================================
RCS file:
/projects/cvsroot/pgsql/src/interfaces/libpgeasy/examples/pgnulltest.c,v
retrieving revision 1.7
diff -r1.7 pgnulltest.c
55c55
<             achar16 char16, \
---
>             achar16 char(16), \
72c72
<    '');");
---
>    'now');");
Index: libpq++/examples/testlibpq4.sql
===================================================================
RCS file:
/projects/cvsroot/pgsql/src/interfaces/libpq++/examples/testlibpq4.sql,v
retrieving revision 1.1
diff -r1.1 testlibpq4.sql
5c5
< CREATE RULE r1 AS ON INSERT TO TBL1 DO [INSERT INTO TBL2 values (new.i);
NOTIFY TBL2];
---
> CREATE RULE r1 AS ON INSERT TO TBL1 DO (INSERT INTO TBL2 values (new.i);
NOTIFY TBL2);
Index: libpq++/examples/testlibpq6.cc
===================================================================
RCS file:
/projects/cvsroot/pgsql/src/interfaces/libpq++/examples/testlibpq6.cc,v
retrieving revision 1.7
diff -r1.7 testlibpq6.cc
28c28
<   if ( !data.ExecCommandOk("CREATE TABLE foo (a int4, b char16, d
float8)") ) {
---
>   if ( !data.ExecCommandOk("CREATE TABLE foo (a int4, b char(16), d
float8)") ) {



Re: patch for examples

From
Tom Lane
Date:
"Permaine Cheung" <pcheung@redhat.com> writes:
> There are a few typos in the examples under src/interfaces.

Actually, I think those are all things that used to be valid ...
long ago, in some cases.  They do need to be fixed now.  Thanks
for the patch!

            regards, tom lane

Re: patch for examples

From
Bruce Momjian
Date:
Patch attached and applied.  Thanks.

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


Permaine Cheung wrote:
> There are a few typos in the examples under src/interfaces.
> The following is a small patch to fix them.
>
> Permaine
> Red Hat Canada Limited
>
>
> Index: libpgeasy/examples/pginsert.c
> ===================================================================
> RCS file:
> /projects/cvsroot/pgsql/src/interfaces/libpgeasy/examples/pginsert.c,v
> retrieving revision 1.7
> diff -r1.7 pginsert.c
> 44c44
> <    achar16 char16, \
> ---
> >    achar16 char(16), \
> Index: libpgeasy/examples/pgnulltest.c
> ===================================================================
> RCS file:
> /projects/cvsroot/pgsql/src/interfaces/libpgeasy/examples/pgnulltest.c,v
> retrieving revision 1.7
> diff -r1.7 pgnulltest.c
> 55c55
> <             achar16 char16, \
> ---
> >             achar16 char(16), \
> 72c72
> <    '');");
> ---
> >    'now');");
> Index: libpq++/examples/testlibpq4.sql
> ===================================================================
> RCS file:
> /projects/cvsroot/pgsql/src/interfaces/libpq++/examples/testlibpq4.sql,v
> retrieving revision 1.1
> diff -r1.1 testlibpq4.sql
> 5c5
> < CREATE RULE r1 AS ON INSERT TO TBL1 DO [INSERT INTO TBL2 values (new.i);
> NOTIFY TBL2];
> ---
> > CREATE RULE r1 AS ON INSERT TO TBL1 DO (INSERT INTO TBL2 values (new.i);
> NOTIFY TBL2);
> Index: libpq++/examples/testlibpq6.cc
> ===================================================================
> RCS file:
> /projects/cvsroot/pgsql/src/interfaces/libpq++/examples/testlibpq6.cc,v
> retrieving revision 1.7
> diff -r1.7 testlibpq6.cc
> 28c28
> <   if ( !data.ExecCommandOk("CREATE TABLE foo (a int4, b char16, d
> float8)") ) {
> ---
> >   if ( !data.ExecCommandOk("CREATE TABLE foo (a int4, b char(16), d
> float8)") ) {
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: src/interfaces/libpgeasy/examples/pginsert.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpgeasy/examples/pginsert.c,v
retrieving revision 1.7
diff -c -r1.7 pginsert.c
*** src/interfaces/libpgeasy/examples/pginsert.c    22 Mar 2001 04:01:23 -0000    1.7
--- src/interfaces/libpgeasy/examples/pginsert.c    7 Jun 2002 03:52:19 -0000
***************
*** 41,47 ****
              afloat     float4, \
              adouble float8, \
              achar    char, \
!             achar16    char16, \
              abpchar char(10), \
              avarchar varchar(50), \
              atext    text, \
--- 41,47 ----
              afloat     float4, \
              adouble float8, \
              achar    char, \
!             achar16    char(16), \
              abpchar char(10), \
              avarchar varchar(50), \
              atext    text, \
Index: src/interfaces/libpgeasy/examples/pgnulltest.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpgeasy/examples/pgnulltest.c,v
retrieving revision 1.7
diff -c -r1.7 pgnulltest.c
*** src/interfaces/libpgeasy/examples/pgnulltest.c    22 Mar 2001 04:01:23 -0000    1.7
--- src/interfaces/libpgeasy/examples/pgnulltest.c    7 Jun 2002 03:52:19 -0000
***************
*** 52,58 ****
              afloat  float4, \
              adouble float8, \
              achar   char, \
!             achar16 char16, \
              abpchar char(10), \
              avarchar varchar(50), \
              atext   text, \
--- 52,58 ----
              afloat  float4, \
              adouble float8, \
              achar   char, \
!             achar16 char(16), \
              abpchar char(10), \
              avarchar varchar(50), \
              atext   text, \
Index: src/interfaces/libpq++/examples/testlibpq4.sql
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq++/examples/testlibpq4.sql,v
retrieving revision 1.1
diff -c -r1.1 testlibpq4.sql
*** src/interfaces/libpq++/examples/testlibpq4.sql    13 Feb 1997 10:00:57 -0000    1.1
--- src/interfaces/libpq++/examples/testlibpq4.sql    7 Jun 2002 03:52:19 -0000
***************
*** 2,5 ****

  CREATE TABLE TBL2 (i int4);

! CREATE RULE r1 AS ON INSERT TO TBL1 DO [INSERT INTO TBL2 values (new.i); NOTIFY TBL2];
--- 2,5 ----

  CREATE TABLE TBL2 (i int4);

! CREATE RULE r1 AS ON INSERT TO TBL1 DO (INSERT INTO TBL2 values (new.i); NOTIFY TBL2);
Index: src/interfaces/libpq++/examples/testlibpq6.cc
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq++/examples/testlibpq6.cc,v
retrieving revision 1.7
diff -c -r1.7 testlibpq6.cc
*** src/interfaces/libpq++/examples/testlibpq6.cc    9 May 2001 17:29:10 -0000    1.7
--- src/interfaces/libpq++/examples/testlibpq6.cc    7 Jun 2002 03:52:19 -0000
***************
*** 25,31 ****
    else cout << "Connected to database '" << dbName << "'..." << endl;

    // Create a new table
!   if ( !data.ExecCommandOk("CREATE TABLE foo (a int4, b char16, d float8)") ) {
        cerr << "CREATE TABLE foo command failed" << endl;
        exit(1);
    }
--- 25,31 ----
    else cout << "Connected to database '" << dbName << "'..." << endl;

    // Create a new table
!   if ( !data.ExecCommandOk("CREATE TABLE foo (a int4, b char(16), d float8)") ) {
        cerr << "CREATE TABLE foo command failed" << endl;
        exit(1);
    }