adding a field
adding a field
От:
Anne Wainwright <anotheranne@fables.co.za>
Дата:
hi, stupid question no.2 to add a field I have to take the data out, add a new field to postgres, add a new (delimiter)field with any default data at the end of each record, then put the data back. right? if I attempt to add a field I will lose the existing data or something bad. right? Anne
Re: adding a field
От:
Thomas Kellerer <spam_eater@gmx.net>
Дата:
Anne Wainwright wrote on 10.08.2012 10:04:
> to add a field I have to take the data out, add a new field to postgres,
> add a new (delimiter)field with any default data at the end of each
> record, then put the data back.
>
> right?
>
No, just add it:
alter table foo add column new_col text;
adds a new character column.
What do you think a "delimiter field" is?
Re: adding a field
От:
Anne Wainwright <anotheranne@fables.co.za>
Дата:
On Fri, Aug 10, 2012 at 10:16:27AM +0200, Thomas Kellerer wrote: > Anne Wainwright wrote on 10.08.2012 10:04: >> to add a field I have to take the data out, add a new field to postgres, >> add a new (delimiter)field with any default data at the end of each >> record, then put the data back. >> >> right? >> > > No, just add it: > > alter table foo add column new_col text; > > adds a new character column. > > What do you think a "delimiter field" is? > adding a field to a delimited record involves putting an extra delimiter (I use |) at the end of each record exported from postgresql into a file. this creates a new blank field to match the table which by now has had a new field added. I actually use Kexi to work on the database, and I know think that it is kexi that enforces this requirement. ie go to the kexi design and add in a field will total the existing data. If my memory is correct a warning comes up when you try to save the revised design. I don't know why, never had this with Paradox (there's history for you!). Anne > > > > > > -- > Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-novice