Raghavendra Reddy <[EMAIL PROTECTED]> writes:
>       While inserting numeric data type into a table can you please let me
> know how you are storing the value in the database.

>From src/include/utils/numeric.h:

/*
 * The Numeric data type stored in the database
 *
 * NOTE: by convention, values in the packed form have been stripped of
 * all leading and trailing zero digits (where a "digit" is of base NBASE).
 * In particular, if the value is zero, there will be no digits at all!
 * The weight is arbitrary in that case, but we normally set it to zero.
 */
typedef struct NumericData
{
    int32       varlen;         /* Variable size (std varlena header) */
    int16       n_weight;       /* Weight of 1st digit  */
    uint16      n_sign_dscale;  /* Sign + display scale */
    char        n_data[1];      /* Digits (really array of NumericDigit) */
} NumericData;

See also the comments at the top of src/backend/utils/adt/numeric.c.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to