File tree 4 files changed +9
-11
lines changed
4 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 5
5
*
6
6
* Copyright (c) 1994, Regents of the University of California
7
7
*
8
- * $Id: analyze.c,v 1.95 1999/01/25 12: 01:05 vadim Exp $
8
+ * $Id: analyze.c,v 1.96 1999/01/27 01:18:20 scrappy Exp $
9
9
*
10
10
*-------------------------------------------------------------------------
11
11
*/
@@ -714,6 +714,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
714
714
index = makeNode (IndexStmt );
715
715
716
716
index -> unique = TRUE;
717
+ index -> primary = (constraint -> contype == CONSTR_PRIMARY ? TRUE:FALSE);
717
718
if (constraint -> name != NULL )
718
719
index -> idxname = constraint -> name ;
719
720
else if (constraint -> contype == CONSTR_PRIMARY )
@@ -722,14 +723,10 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
722
723
elog (ERROR , "CREATE TABLE/PRIMARY KEY multiple keys for table %s are not legal" , stmt -> relname );
723
724
724
725
have_pkey = TRUE;
725
- index -> primary = TRUE;
726
726
index -> idxname = makeTableName (stmt -> relname , "pkey" , NULL );
727
727
}
728
728
else
729
- {
730
- index -> primary = FALSE;
731
729
index -> idxname = NULL ;
732
- }
733
730
734
731
index -> relname = stmt -> relname ;
735
732
index -> accessMethod = "btree" ;
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.166 1999/01/17 06:19:19 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.167 1999/01/27 01:18:21 scrappy Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -1509,7 +1509,8 @@ do_connect(const char *new_dbname,
1509
1509
PGCLIENTENCODING value. -- 1998/12/12 Tatsuo Ishii */
1510
1510
1511
1511
if (!has_client_encoding ) {
1512
- unsetenv ("PGCLIENTENCODING" );
1512
+ static const char ev [] = "PGCLIENTENCODING=" ;
1513
+ putenv (ev );
1513
1514
}
1514
1515
#endif
1515
1516
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.88 1999/01/17 06:19:35 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.89 1999/01/27 01:18:22 scrappy Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -816,7 +816,7 @@ PQsetenv(PGconn *conn)
816
816
#ifdef MULTIBYTE
817
817
/* query server encoding */
818
818
env = getenv (envname );
819
- if (!env )
819
+ if (!env || * env == NULL )
820
820
{
821
821
rtn = PQexec (conn , "select getdatabaseencoding()" );
822
822
if (rtn && PQresultStatus (rtn ) == PGRES_TUPLES_OK )
Original file line number Diff line number Diff line change 9
9
* didn't really belong there.
10
10
*
11
11
* IDENTIFICATION
12
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.15 1998/10/06 14:16:50 tgl Exp $
12
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.16 1999/01/27 01:18:23 scrappy Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -506,7 +506,7 @@ PQmblen(unsigned char *s)
506
506
int encoding = -1 ;
507
507
508
508
str = getenv ("PGCLIENTENCODING" );
509
- if (str )
509
+ if (str && * str != NULL )
510
510
encoding = pg_char_to_encoding (str );
511
511
if (encoding < 0 )
512
512
encoding = MULTIBYTE ;
You can’t perform that action at this time.
0 commit comments