Search Postgresql Archives

Can I get Field informations from system tables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I must get informations about the tables.
For example:
Tnnn:
1. [Field Name, Type, Size, NotNull]
2. [Field Name, Type, Size, NotNull]
...

The test table is this:

CREATE TABLE testfields
(
  fbigint bigint NOT NULL,
  fbool boolean,
  fchar character(100),
  fcharv character varying(100),
  fdate date,
  fdouble double precision,
  fint integer,
  fnum numeric,
  fmemo text,
  ftimez time with time zone,
  ftime time without time zone,
  ftimestampz timestamp with time zone,
  ftimestamp timestamp without time zone,
  fserial serial NOT NULL,
  CONSTRAINT testfields_pkey PRIMARY KEY (fserial)
)

When I see Pygresql, I got only these informations:

Command line: C:\Python25\python.exe c:\PGDB_T~1.PY
Working directory: c:\
Timeout: 0 ms

[{'FSERIAL': 1, 'FMEMO': 'fdsf sdf dsfds sdd sfsdfsdfsd dsfsd sdfsd ssdsd sdsd', 'FCHAR': 'alma                                                                                                ', 'FBIGINT': 1L, 'FNUM': Decimal("454.3234"), 'FTIMESTAMPZ': '1999-01-01 10:10:10+01', 'FINT': 43545, 'FTIMEZ': '10:10:10+02', 'FDOUBLE': 4.5656656, 'FTIME': '10:10:10', 'FCHARV': 'alma', 'FDATE': '1999-03-25', 'FTIMESTAMP': '1999-01-01 10:10:10', 'FBOOL': True}]

('fbigint', 'int8', None, 8, None, None, None)
('fbool', 'bool', None, 1, None, None, None)
('fchar', 'bpchar', None, -1, None, None, None)
('fcharv', 'varchar', None, -1, None, None, None)
('fdate', 'date', None, 4, None, None, None)
('fdouble', 'float8', None, 8, None, None, None)
('fint', 'int4', None, 4, None, None, None)
('fnum', 'numeric', None, -1, None, None, None)
('fmemo', 'text', None, -1, None, None, None)
('ftimez', 'timetz', None, 12, None, None, None)
('ftime', 'time', None, 8, None, None, None)
('ftimestampz', 'timestamptz', None, 8, None, None, None)
('ftimestamp', 'timestamp', None, 8, None, None, None)
('fserial', 'int4', None, 4, None, None, None)

Process "Python Interpeter" terminated, ExitCode: 00000000

The main problem that I don't see the size of the char/varchar fields, and I don't determine that int field is serial or not?

Thanks for the help:
   dd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux