Re: [SQL] string functions and operators

2010-03-23 Thread Andreas Gaab
Why not using text-function substring: SELECT split_part(123.456::text,'.',1)::integer; SELECT split_part(123.456::text,'.',2)::integer; Regards, Andreas -Ursprüngliche Nachricht- Von: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] Im Auftrag von Petru Ghita Gese

Re: [SQL] ALTER TYPE my_enum AS ENUM ADD ('label10')

2010-03-23 Thread A. Kretschmer
In response to Andreas Gaab : > I tried successfully to directly insert a further entry into table > pg_enum with the corresponding enumtypid. Do you think to directly > manipulate table pg_enum is allowed? It's maybe allowed, but not recommended. It's a system-table, not a user-table. Andreas -

Re: [SQL] string functions and operators

2010-03-23 Thread Little, Douglas
Here's a thought create table test1(col1 decimal(7,1)); insert into test1 values(77.1),(77.2),(134.1),(134.2),(134.3),(5.1),(5.2) select col1::integer from test1; select substr((col1-col1::integer),3) from test1; doug From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org