Re: [SQL] Changing Column Type

2002-09-10 Thread Kevin Brannen
Peter Atkins wrote: > All, > > Is there a way to easily change the type of column? Or do I have to drop > and create again. > > From: > assignment_notes | character varying(255) > > To: > assignment_notes | text Do that kind of change will require creating a new table, copying the data, drop

Re: [SQL] Retrieving the new "nextval" for primary keys....

2002-08-28 Thread Kevin Brannen
Greg Patnude wrote: > I am using postgreSQL with Perl::CGI and Perl::DBI::Pg... I would like to be > able to insert a row from my Perl script [$SQL->exec();] and have postgreSQL > return the id of the newly inserted record (new.id) directly to the Perl > script for further processing... Anyone wit

datatype matrix (was: Re: [SQL] Sorry..)

2002-07-16 Thread Kevin Brannen
Josh Berkus wrote: > Christopher, > > >>In the bad old days when we couldn't distinguish explicit from implicit >>cast functions, I was wary of adding new cast pathways. Too many >>implicit casts and you have no type system at all. But in 7.3 there >>should be no reason to object to an explici

Re: [SQL] is there a way to get hh:mm:ss given seconds

2002-07-09 Thread Kevin Brannen
Tod McQuillin wrote: > On Mon, 8 Jul 2002, Narendra A wrote: > > >>Is there a way in sql such that if I give seconds it should me return me >>hours:mins:seconds >> >>Eg. Seconds hh:mm:ss >>422 1:01:02 > > > foo=# select '422 seconds'::interval; > interval > -- > 00:0

Re: [SQL] bit field changes in 7.2.1

2002-07-08 Thread Kevin Brannen
Peter Eisentraut wrote: > Kevin Brannen writes: > > >>EXCEPT that now fails in 7.2.1 (I just upgraded this afternoon). It >>forces me to use "b'00'" instead of "b'0'::bit(6)". > > > Which is a problem why? Because

[SQL] bit field changes in 7.2.1

2002-07-03 Thread Kevin Brannen
I'm on a Linux RH 7.2 system, which came with Pg 7.1.2 (I think). When there, I prototyped some code that worked well, and looked like: create table ref_sp ( name varchar(10), sname char(1), bitmask bit(6) ); insert into ref_sp values ('one', '1', b'01'); insert into ref_sp

[SQL] is it easy to change the create sequence algorithm?

2002-06-21 Thread Kevin Brannen
I see in the docs that when I create a column that is of type SERIAL, the engine automatically creates the sequence for me, named TABLE_COLUMN_seq. That's great until the table name + column name lengths are > 27 chars, then it starts chopping, and you guessed it, I have multiple table/column