*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: analyze.c,v 1.95 1999/01/25 12:01:05 vadim Exp $
+ * $Id: analyze.c,v 1.96 1999/01/27 01:18:20 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
index = makeNode(IndexStmt);
index->unique = TRUE;
+ index->primary = (constraint->contype == CONSTR_PRIMARY ? TRUE:FALSE);
if (constraint->name != NULL)
index->idxname = constraint->name;
else if (constraint->contype == CONSTR_PRIMARY)
elog(ERROR, "CREATE TABLE/PRIMARY KEY multiple keys for table %s are not legal", stmt->relname);
have_pkey = TRUE;
- index->primary = TRUE;
index->idxname = makeTableName(stmt->relname, "pkey", NULL);
}
else
- {
- index->primary = FALSE;
index->idxname = NULL;
- }
index->relname = stmt->relname;
index->accessMethod = "btree";
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.166 1999/01/17 06:19:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.167 1999/01/27 01:18:21 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
PGCLIENTENCODING value. -- 1998/12/12 Tatsuo Ishii */
if (!has_client_encoding) {
- unsetenv("PGCLIENTENCODING");
+ static const char ev[] = "PGCLIENTENCODING=";
+ putenv(ev);
}
#endif
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.88 1999/01/17 06:19:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.89 1999/01/27 01:18:22 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef MULTIBYTE
/* query server encoding */
env = getenv(envname);
- if (!env)
+ if (!env || *env == NULL)
{
rtn = PQexec(conn, "select getdatabaseencoding()");
if (rtn && PQresultStatus(rtn) == PGRES_TUPLES_OK)
* didn't really belong there.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.15 1998/10/06 14:16:50 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.16 1999/01/27 01:18:23 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
int encoding = -1;
str = getenv("PGCLIENTENCODING");
- if (str)
+ if (str && *str != NULL)
encoding = pg_char_to_encoding(str);
if (encoding < 0)
encoding = MULTIBYTE;