pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #14460: ecpg dynamic describe data types incorrect
2+ messages / 2 participants
[nested] [flat]
* BUG #14460: ecpg dynamic describe data types incorrect
@ 2016-12-12 15:36 gary.cowell@gmail.com
2016-12-17 15:32 ` Re: BUG #14460: ecpg dynamic describe data types incorrect Michael Meskes <meskes@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: gary.cowell@gmail.com @ 2016-12-12 15:36 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 14460
Logged by: gary surname
Email address: gary.cowell@gmail.com
PostgreSQL version: 9.5.5
Operating system: Red Hat Linux 7
Description:
If you have a table:
gc=> \d tajsplne
Table "public.tajsplne"
Column | Type | Modifiers
--------+-----------------------+-----------
a | character varying(20) |
b | text |
c | character(10) |
d | integer |
four different data types.
Insert a row:
gc=> insert into tajsplne values ('var','text','char',1);
INSERT 0 1
gc=> \q
Then run an ecpg program to select and describe the data, the data types
come back as:
a = var (type: 1)
b = text (type: 1)
c = char (type: 1)
d = 1 (type: 5)
I.e. the sqlda data types for the CHAR , VARCHAR and TEXT columns, is all
type 1.
According to ecpgtype.h
enum ECPGttype
{
ECPGt_char = 1, ECPGt_unsigned_char, ECPGt_short,
ECPGt_unsigned_short,
ECPGt_int, ECPGt_unsigned_int, ECPGt_long, ECPGt_unsigned_long,
ECPGt_long_long, ECPGt_unsigned_long_long,
ECPGt_bool,
ECPGt_float, ECPGt_double,
ECPGt_varchar, ECPGt_varchar2,
ECPGt_numeric, /* this is a decimal that
stores its digits in
* a
malloced array */
ECPGt_decimal, /* this is a decimal that
stores its digits in
* a fixed
array */
ECPGt_date,
ECPGt_timestamp,
ECPGt_interval,
ECPGt_array,
ECPGt_struct,
ECPGt_union,
ECPGt_descriptor, /* sql descriptor, no C
variable */
ECPGt_char_variable,
ECPGt_const, /* a constant is needed
sometimes */
ECPGt_EOIT, /* End of insert
types. */
ECPGt_EORT, /* End of result
types. */
ECPGt_NO_INDICATOR, /* no indicator */
ECPGt_string, /* trimmed (char *) type
*/
ECPGt_sqlda /* C struct
descriptor */
};
the varchar at least should be type 14, yes? Though not much clue what the
TEXT type should be.
Have I a misunderstanding, or is this a bug?
Thanks
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #14460: ecpg dynamic describe data types incorrect
2016-12-12 15:36 BUG #14460: ecpg dynamic describe data types incorrect gary.cowell@gmail.com
@ 2016-12-17 15:32 ` Michael Meskes <meskes@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Meskes @ 2016-12-17 15:32 UTC (permalink / raw)
To: pgsql-bugs; +Cc: gary.cowell@gmail.com
> Then run an ecpg program to select and describe the data, the data
> types
> come back as:
>
> a = var (type: 1)
> b = text (type: 1)
> c = char (type: 1)
> d = 1 (type: 5)
>
> I.e. the sqlda data types for the CHAR , VARCHAR and TEXT columns, is
> all
> type 1.
CHAR and TEXT should be the same. However, varchar should be different
IIRC. There is definitely a case that maps VARCHAROID
to SQL3_CHARACTER_VARYING which equals 12. Does the log file, if you
enable debugging, show the same type information?
> According to ecpgtype.h
> ...
ecpgtype.h is PostgreSQL internal type information, the descriptor is
supposed to handle types as defined by the standard. Those definitions
are in sql3types.h.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-12-17 15:32 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-12 15:36 BUG #14460: ecpg dynamic describe data types incorrect gary.cowell@gmail.com
2016-12-17 15:32 ` Michael Meskes <meskes@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox