| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0249c24 commit d9b679c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 9 | 9 | * Portions Copyright (c) 1994, Regents of the University of California | |
| 10 | 10 | * | |
| 11 | 11 | * IDENTIFICATION | |
| 12 | - * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.72 2003/05/09 18:08:48 tgl Exp $ | ||
| 12 | + * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.73 2003/05/13 18:39:50 tgl Exp $ | ||
| 13 | 13 | * | |
| 14 | 14 | *------------------------------------------------------------------------- | |
| 15 | 15 | */ | |
@@ -181,6 +181,10 @@ SendRowDescriptionMessage(TupleDesc typeinfo, List *targetlist, int16 *formats) | |||
| 181 | 181 | ||
| 182 | 182 | for (i = 0; i < natts; ++i) | |
| 183 | 183 | { | |
| 184 | + Oid atttypid = attrs[i]->atttypid; | ||
| 185 | + int32 atttypmod = attrs[i]->atttypmod; | ||
| 186 | + Oid basetype; | ||
| 187 | + | ||
| 184 | 188 | pq_sendstring(&buf, NameStr(attrs[i]->attname)); | |
| 185 | 189 | /* column ID info appears in protocol 3.0 and up */ | |
| 186 | 190 | if (proto >= 3) | |
@@ -204,14 +208,18 @@ SendRowDescriptionMessage(TupleDesc typeinfo, List *targetlist, int16 *formats) | |||
| 204 | 208 | pq_sendint(&buf, 0, 2); | |
| 205 | 209 | } | |
| 206 | 210 | } | |
| 207 | - pq_sendint(&buf, (int) attrs[i]->atttypid, | ||
| 208 | - sizeof(attrs[i]->atttypid)); | ||
| 209 | - pq_sendint(&buf, attrs[i]->attlen, | ||
| 210 | - sizeof(attrs[i]->attlen)); | ||
| 211 | + /* If column is a domain, send the base type and typmod instead */ | ||
| 212 | + basetype = getBaseType(atttypid); | ||
| 213 | + if (basetype != atttypid) | ||
| 214 | + { | ||
| 215 | + atttypmod = get_typtypmod(atttypid); | ||
| 216 | + atttypid = basetype; | ||
| 217 | + } | ||
| 218 | + pq_sendint(&buf, (int) atttypid, sizeof(atttypid)); | ||
| 219 | + pq_sendint(&buf, attrs[i]->attlen, sizeof(attrs[i]->attlen)); | ||
| 211 | 220 | /* typmod appears in protocol 2.0 and up */ | |
| 212 | 221 | if (proto >= 2) | |
| 213 | - pq_sendint(&buf, attrs[i]->atttypmod, | ||
| 214 | - sizeof(attrs[i]->atttypmod)); | ||
| 222 | + pq_sendint(&buf, atttypmod, sizeof(atttypmod)); | ||
| 215 | 223 | /* format info appears in protocol 3.0 and up */ | |
| 216 | 224 | if (proto >= 3) | |
| 217 | 225 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments