mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 17:19:32 +02:00
* Added support for stColumns to GetSchemaInfoSQL
git-svn-id: trunk@10744 -
This commit is contained in:
parent
8f12825af2
commit
8f985fbdee
@ -851,6 +851,27 @@ begin
|
||||
'where '+
|
||||
'relkind=''r''' +
|
||||
'order by relname';
|
||||
stColumns : s := 'select '+
|
||||
'a.attnum as recno, '+
|
||||
''''' as catalog_name, '+
|
||||
''''' as schema_name, '+
|
||||
'c.relname as table_name, '+
|
||||
'a.attname as column_name, '+
|
||||
'0 as column_position, '+
|
||||
'0 as column_type, '+
|
||||
'0 as column_datatype, '+
|
||||
''''' as column_typename, '+
|
||||
'0 as column_subtype, '+
|
||||
'0 as column_precision, '+
|
||||
'0 as column_scale, '+
|
||||
'a.atttypmod as column_length, '+
|
||||
'not a.attnotnull as column_nullable '+
|
||||
'from '+
|
||||
' pg_class c, pg_attribute a '+
|
||||
'WHERE '+
|
||||
// This can lead to problems when case-sensitive tablenames are used.
|
||||
'(c.oid=a.attrelid) and (a.attnum>0) and (not a.attisdropped) and (upper(c.relname)=''' + Uppercase(SchemaObjectName) + ''') ' +
|
||||
'order by a.attname';
|
||||
else
|
||||
DatabaseError(SMetadataUnavailable)
|
||||
end; {case}
|
||||
|
Loading…
Reference in New Issue
Block a user