pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedToo short field
7+ messages / 4 participants
[nested] [flat]
* Too short field
@ 2019-07-03 11:30 Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
0 siblings, 2 replies; 7+ messages in thread
From: Karl Martin Skoldebrand @ 2019-07-03 11:30 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Hi,
We solved the problem of yesterday where I was looking at sequences. It eventually turned that sequence was irrelevant (at least in the PostgreSQL sense) to the problem.
Now, we have a bug in another application that prevents an automatic tool to enter certain users in the database. The organisational field is varchar(60) while the actual Organisation "abbreviation" may be as long as 70 characters (don't ask why).
What happens to data if I simple redefine the table field as varchar(80) (or something, at least 70+). Does "everything" break database side or can I just go on running the app as is.
Do we need to restart databases or something else that requires an interrupted service?
Best regards,
Martin S
============================================================================================================================
Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html <http://www.techmahindra.com/Disclaimer.html; externally http://tim.techmahindra.com/tim/disclaimer.html <http://tim.techmahindra.com/tim/disclaimer.html; internally within TechMahindra.
============================================================================================================================
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Too short field
@ 2019-07-03 11:56 Thomas Kellerer <spam_eater@gmx.net>
parent: Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
1 sibling, 2 replies; 7+ messages in thread
From: Thomas Kellerer @ 2019-07-03 11:56 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30:
> Now, we have a bug in another application that prevents an automatic
> tool to enter certain users in the database. The organisational field
> is varchar(60) while the actual Organisation “abbreviation” may be as
> long as 70 characters (don’t ask why).
>
> What happens to data if I simple redefine the table field as
> varchar(80) (or something, at least 70+). Does “everything” break
> database side or can I just go on running the app as is.
Nothing will break on the database size.
> Do we need to restart databases or something else that requires an
> interrupted service?
No, you just run
ALTER the_table ALTER COLUMN organisational TYPE varchar(80);
It requires an exclusive lock on the table, but the actual operation
will finish in a few milliseconds because the table is not physically
changed (as the limit is only increased).
Getting the exlusive lock might take a while if the table is actively
used, so the ALTER statement itself might look as it would take a while,
but once the lock could be obtained the change is very fast.
There is no real need to stop anything if you can anticipate that there
will be a few (milli)seconds where the ALTER statement succeeds in
obtainin (and releasing) the lock.
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: Too short field
@ 2019-07-03 12:02 Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
parent: Thomas Kellerer <spam_eater@gmx.net>
1 sibling, 0 replies; 7+ messages in thread
From: Karl Martin Skoldebrand @ 2019-07-03 12:02 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Thanks.
That is what I thought - good to have a confirmation.
Best regards,
Martin S
============================================================================================================================
Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html <http://www.techmahindra.com/Disclaimer.html; externally http://tim.techmahindra.com/tim/disclaimer.html <http://tim.techmahindra.com/tim/disclaimer.html; internally within TechMahindra.
============================================================================================================================
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Too short field
@ 2019-07-03 12:10 Karsten Hilbert <Karsten.Hilbert@gmx.net>
parent: Thomas Kellerer <spam_eater@gmx.net>
1 sibling, 1 reply; 7+ messages in thread
From: Karsten Hilbert @ 2019-07-03 12:10 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On Wed, Jul 03, 2019 at 01:56:03PM +0200, Thomas Kellerer wrote:
> Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30:
> > Now, we have a bug in another application that prevents an automatic
> > tool to enter certain users in the database. The organisational field
> > is varchar(60) while the actual Organisation “abbreviation” may be as
> > long as 70 characters (don’t ask why).
> >
> > What happens to data if I simple redefine the table field as
> > varchar(80) (or something, at least 70+). Does “everything” break
> > database side or can I just go on running the app as is.
>
> Nothing will break on the database size.
We don't know. There may be functions in triggers or for
direct use which rely on the assumption that it be 60 chars
max.
PostgreSQL itself won't care, that much holds.
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Too short field
@ 2019-07-03 12:21 Karsten Hilbert <Karsten.Hilbert@gmx.net>
parent: Karsten Hilbert <Karsten.Hilbert@gmx.net>
0 siblings, 1 reply; 7+ messages in thread
From: Karsten Hilbert @ 2019-07-03 12:21 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On Wed, Jul 03, 2019 at 02:10:55PM +0200, Karsten Hilbert wrote:
> > Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30:
> > > Now, we have a bug in another application that prevents an automatic
> > > tool to enter certain users in the database. The organisational field
> > > is varchar(60) while the actual Organisation “abbreviation” may be as
> > > long as 70 characters (don’t ask why).
> > >
> > > What happens to data if I simple redefine the table field as
> > > varchar(80) (or something, at least 70+). Does “everything” break
> > > database side or can I just go on running the app as is.
> >
> > Nothing will break on the database size.
>
> We don't know.
Sorry, I didn't read properly:
>>> What happens to >>data<< if I simple redefine the table field
Nothing should happen to the data.
But:
> There may be functions in triggers or for direct use which
> rely on the assumption that it be 60 chars max.
:)
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: Too short field
@ 2019-07-03 12:22 Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
parent: Karsten Hilbert <Karsten.Hilbert@gmx.net>
0 siblings, 0 replies; 7+ messages in thread
From: Karl Martin Skoldebrand @ 2019-07-03 12:22 UTC (permalink / raw)
To: karsten.hilbert@gmx.net <karsten.hilbert@gmx.net>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Valid point.
I've added that to the report.
Best regards,
Martin Skjoldebrand
============================================================================================================================
Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html <http://www.techmahindra.com/Disclaimer.html; externally http://tim.techmahindra.com/tim/disclaimer.html <http://tim.techmahindra.com/tim/disclaimer.html; internally within TechMahindra.
============================================================================================================================
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Too short field
@ 2019-07-03 22:22 Gavin Flower <GavinFlower@archidevsys.co.nz>
parent: Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
1 sibling, 0 replies; 7+ messages in thread
From: Gavin Flower @ 2019-07-03 22:22 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 03/07/2019 23:30, Karl Martin Skoldebrand wrote:
>
> Hi,
>
> We solved the problem of yesterday where I was looking at sequences.
> It eventually turned that sequence was irrelevant (at least in the
> PostgreSQL sense) to the problem.
>
> Now, we have a bug in another application that prevents an automatic
> tool to enter certain users in the database. The organisational field
> is varchar(60) while the actual Organisation “abbreviation” may be as
> long as 70 characters (don’t ask why).
>
> What happens to data if I simple redefine the table field as
> varchar(80) (or something, at least 70+). Does “everything” break
> database side or can I just go on running the app as is.
>
> Do we need to restart databases or something else that requires an
> interrupted service?
>
> Best regards,
>
> Martin S
>
> ============================================================================================================================
>
> Disclaimer: This message and the information contained herein is
> proprietary and confidential and subject to the Tech Mahindra policy
> statement, you may review the policy at
> http://www.techmahindra.com/Disclaimer.html externally
> http://tim.techmahindra.com/tim/disclaimer.html internally within
> TechMahindra.
>
> ============================================================================================================================
>
Is there any reason to put a limit of the number of characters in the
field in the database?
If not, consider using, the 'text' type.
Cheers,
Gavin
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2019-07-03 22:22 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03 11:30 Too short field Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
2019-07-03 11:56 ` Thomas Kellerer <spam_eater@gmx.net>
2019-07-03 12:02 ` Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
2019-07-03 12:10 ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
2019-07-03 12:21 ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
2019-07-03 12:22 ` Karl Martin Skoldebrand <KS0C77263@TechMahindra.com>
2019-07-03 22:22 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox