/*
-- Create a type and a table using that type with a defaultvalue in the database:
drop table if exists testtab;
drop type if exists testtype;
drop type if exists new_testtype;
create type testtype as enum
(
'OK',
'NOTOK'
);
create table testtab
(
t testtype default 'OK'
);
*/
PgSqlConnection conn = EdGlobals.Connection;
var v = EdGlobals.Connection.GetSchema("Columns", new string[] { "%", "testtab", "%" }).Rows[0]["defaultvalue"];
// Result is RIGHT:
//'OK'::testtype
/*
-- Now, change the name of the type in the database:
alter type testtype rename to new_testtype;
*/
v = EdGlobals.Connection.GetSchema("Columns", new string[] { "%", "testtab", "%" }).Rows[0]["defaultvalue"];
// Result is WRONG: !!!!!!
//'OK'::testtype
/*
-- Querying the information-schema the following way always delivers the right values:
SELECT column_name, column_default
FROM information_schema.columns
WHERE (table_schema, table_name) = ('public', 'testtab')
ORDER BY ordinal_position;
*/
Connection.GetSchema(...) delivers wrong defaultvalue after renaming a defaultvalue of a enum-table column in database
-
- Posts: 6
- Joined: Fri 26 Mar 2010 09:48
- Location: Germany
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Connection.GetSchema(...) delivers wrong defaultvalue after renaming a defaultvalue of a enum-table column in database
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Connection.GetSchema(...) delivers wrong defaultvalue after renaming a defaultvalue of a enum-table column in database
We have fixed the bug with retrieving default value data for table columns when calling the PgSqlConnection.GetSchema("Columns") method. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Connection.GetSchema(...) delivers wrong defaultvalue after renaming a defaultvalue of a enum-table column in database
The new build of dotConnect for PostgreSQL 6.6.267 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=27384
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=27384