BUG #2395: Can't get right type oid by PQftype.

Поиск
Список
Период
Сортировка
От wangshj
Тема BUG #2395: Can't get right type oid by PQftype.
Дата
Msg-id 200604140630.k3E6UAZk059778@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2395: Can't get right type oid by PQftype.  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2395
Logged by:          wangshj
Email address:      wangshj@sduept.com
PostgreSQL version: 8.1.3
Operating system:   CentOS release 4.3 (Final)
Description:        Can't get right type oid  by PQftype.
Details:

I create a domain type testdomainoid.

CREATE DOMAIN testdomainoid int  CHECK(value >20);

In my database,the type oid of testdomainoid is 16385.But PQftype return 23
for testdomainoid's type oid.How could I get the testdomainoid's type oid.

--Creating a table use domain type.
CREATE TABLE test_domain_oid ( col testdomainoid );

--Insert a value.
INSERT INTO test_domain_oid VALUES (30);

//following is my test code.
#include <iostream>
#include "libpq-fe.h"
#include <sstream>

int main(int argc, char ** argv){
        PGconn * conn = PQconnectdb("");
        if( CONNECTION_OK != PQstatus(conn ) )
        {
                std::cout << "\nCan't connecte to db\n";
                return 0;
        }

        PGresult * r = PQexec( conn, "SELECT col FROM test_domain_oid " );
        if( PGRES_TUPLES_OK == PQresultStatus(r) )
        {
                Oid id = PQftype( r, 0 );
                int mod = PQfmod( r, 0 );
                std::cout<<"\noid: " << id<<"\nmod:" << mod <<std::endl;
        }
        else
        {
                std::cout << "\nQuery failed..\n";
                return 0;
        }

        PQclear( r );
        PQfinish( conn );
};

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Alexander Kirpa"
Дата:
Сообщение: BUG #2394: Multiple TRUNCATE within transaction
Следующее
От: "Péter Szabó"
Дата:
Сообщение: BUG #2397: 1 = SELECT ASCII(CHR(257))