From: Shra <shravan(at)yaskatech(dot)com>
To: "Postgre- Bugs" <pgsql-bugs(at)postgresql(dot)org>
Cc: "Postgre- Committers" <pgsql-committers(at)postgresql(dot)org>, "PostgreSQL- Development" <pgsql-hackers(at)postgresql(dot)org>
Subject:
Date: 2002-04-26 19:29:55
Message-ID: f02042711021100AE@yaskatech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-committers pgsql-hackers


Hi all,

I have a problem with metadata.........just read this .......

Let us simply suppose a table "test" with 2 fileds "name (varchar(10))" and
"age (numeric)" and there b values as name="abc",age="20".

Now in a function i need to develop a list where the column header info has
to b made in this format i.e., as "column name, column type, column
width".........

am getting the column name using PQfname function, column type using PQftype
and column size using PQfsize....... am also able to get each filed values n
their size correctly..........

but the problem now is ......when i use PQfsize to get the column header size
then i get a -1 if the field is a variable length in nature else i get the
exact size........i.e., in the above declared table for both the name and age
being variable fields am getting -1 for their size.......now i need some
mechanism to get 10 for "name" header and number of bytes allocated for
"age"(30,6).......is their any way to overcome this problem?

Is this a draw back in Postgre? Is there any way i can get the exact size
that i allocated when creating the table.....infact most of the other
databases do provide APIs with not having this problem........can anyone help
me, please.........

Shra

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-04-26 21:58:02 Bug #650: using a trigger like a sequence doesn't work
Previous Message Tom Lane 2002-04-26 14:59:22 Re: regular expression and index on 7.2

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2002-04-26 19:47:35 pgsql/. configure.in configure
Previous Message Tom Lane 2002-04-26 19:29:47 pgsql/src include/commands/tablecmds.h include ...

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-26 20:33:00 Re: WAL -> Replication
Previous Message Bruce Momjian 2002-04-26 18:32:19 Re: Vote totals for SET in aborted transaction