On 1/22/07, Jim C. Nasby <[EMAIL PROTECTED]> wrote:
> kelly=# update pg_attribute set atttypid=25, atttypmod=-1
> kelly-# where attname = 'c1' and attrelid =
> kelly-# (select oid from pg_class where relname = 'foo');
> UPDATE 1
Also, you could replace that pg_class sub-select with "'fo
On Sat, Jan 20, 2007 at 11:19:50AM -0600, Kelly Burkhart wrote:
> On 1/20/07, Shoaib Mir <[EMAIL PROTECTED]> wrote:
> >Should help --> ALTER TABLE tablename ALTER columname TYPE text;
>
> I was looking for a way to alter a column from varchar(n) to text
> without using the alter command and conseq
From: "Kelly Burkhart" <[EMAIL PROTECTED]>
> On 1/20/07, Shoaib Mir <[EMAIL PROTECTED]> wrote:
> > Should help --> ALTER TABLE tablename ALTER columname TYPE text;
>
> I was looking for a way to alter a column from varchar(n) to text
> without using the alter command and consequently touching ever
I haven't used it this way, anyone else who did might be able to comment on
it. Why will you not like to use the ALTER table command? I think a text
should be use in case you don't know the limit for characters (much faster
too in that case I guess) in a column but if you know the limits then you
On 1/20/07, Shoaib Mir <[EMAIL PROTECTED]> wrote:
Should help --> ALTER TABLE tablename ALTER columname TYPE text;
I was looking for a way to alter a column from varchar(n) to text
without using the alter command and consequently touching every single
row. Below is sql which seems to work, but
Should help --> ALTER TABLE tablename ALTER columname TYPE text;
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
On 1/20/07, Kelly Burkhart <[EMAIL PROTECTED]> wrote:
On 1/19/07, Martijn van Oosterhout wrote:
>
> ALTER TABLE, to be correct, actually has to check the entire tab
On 1/19/07, Martijn van Oosterhout wrote:
ALTER TABLE, to be correct, actually has to check the entire table to
make sure it's ok. By doing it directly you're basically telling the DB
it's OK.
For making a varchar column longer it's safe though, and the easiest way.
Is it possible to use a s
[EMAIL PROTECTED] wrote:
> Thanks. Am I correct in assuming that this scanning of the entire
> table is done when I use the 'ALTER TABLE' command and not something I
> must do after it's done?
Yes, ALTAR TABLE ... scans through the entire table when it does the
update, it's not something you ne
On Thu, Jan 18, 2007 at 06:27:04AM -0800, [EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> > Using ALTER TABLE ALTER TYPE VARCHAR() to
> > change the size requires scanning the entire table. For large tables,
> > this will be much slower than the pg_attribute query. Both will get
> > the j
[EMAIL PROTECTED] wrote:
> Hello,
>
> The +4 is for the overhead of a varchar field.
>
> Using ALTER TABLE ALTER TYPE VARCHAR() to
> change the size requires scanning the entire table. For large tables,
> this will be much slower than the pg_attribute query. Both will get
> the job done.
>
Th
Hello,
The +4 is for the overhead of a varchar field.
Using ALTER TABLE ALTER TYPE VARCHAR() to
change the size requires scanning the entire table. For large tables,
this will be much slower than the pg_attribute query. Both will get
the job done.
[EMAIL PROTECTED] wrote:
> Hello,
>
> In thi
11 matches
Mail list logo