On Wed, 3 Jul 2024, Adrian Klaver wrote:
alter table array_conv alter column email type varchar[] using array[email];
select * from array_conv ;
id |email
+-
1 | {adrian.kla...@aklaver.com}
2 | {akla...@example.com}
Adrian,
Given my inexperience
On 7/3/24 07:13, Rich Shepard wrote:
On Wed, 3 Jul 2024, David G. Johnston wrote:
Yeah, the simply cast suggested will not work. You’d have to apply an
expression that turns the current contents into an array. The current
contents are not likely to be an array literal.
David,
No, it's not no
On 2024-07-03 07:13:47 -0700, Rich Shepard wrote:
> On Wed, 3 Jul 2024, David G. Johnston wrote:
> > Yeah, the simply cast suggested will not work. You’d have to apply an
> > expression that turns the current contents into an array. The current
> > contents are not likely to be an array literal.
>
On Wed, Jul 3, 2024 at 7:13 AM Rich Shepard
wrote:
> On Wed, 3 Jul 2024, David G. Johnston wrote:
>
> > Yeah, the simply cast suggested will not work. You’d have to apply an
> > expression that turns the current contents into an array. The current
> > contents are not likely to be an array litera
Check this out
https://www.postgresql.org/docs/16/arrays.html#ARRAYS-INPUT
You can use
('{' || email || '}')::varchar(64)[]
or the syntax I suggested earlier.
On Wed, Jul 3, 2024 at 4:13 PM Rich Shepard
wrote:
> On Wed, 3 Jul 2024, David G. Johnston wrote:
>
> > Yeah, the simply cast sugge
On Wed, 3 Jul 2024, David G. Johnston wrote:
Yeah, the simply cast suggested will not work. You’d have to apply an
expression that turns the current contents into an array. The current
contents are not likely to be an array literal.
David,
No, it's not now an array.
I thought that this expre
The USING phrase basically answers the question how do I convert an
existing value of the old type to the new type.
On Wed, Jul 3, 2024 at 4:03 PM Rich Shepard
wrote:
> On Wed, 3 Jul 2024, Rich Shepard wrote:
>
> > What I've tried:
> > bustrac=# alter table people alter column email set data typ
On Wednesday, July 3, 2024, Rich Shepard wrote:
> On Wed, 3 Jul 2024, Rich Shepard wrote:
>
> What I've tried:
>> bustrac=# alter table people alter column email set data type varchar(64)
>> [];
>> ERROR: column "email" cannot be cast automatically to type character
>> varying[]
>> HINT: You mi
You could try
ALTER TABLE ... SET TYPE TEXT[] USING ARRAY[email]::TEXT[]
something along these lines.
On Wed, Jul 3, 2024 at 3:58 PM Rich Shepard
wrote:
> On Tue, 2 Jul 2024, Christophe Pettus wrote:
>
> > To be clear, I wasn't suggesting stuffing them all into a text column
> with
> > a delim
On Wed, 3 Jul 2024, Rich Shepard wrote:
What I've tried:
bustrac=# alter table people alter column email set data type varchar(64) [];
ERROR: column "email" cannot be cast automatically to type character
varying[]
HINT: You might need to specify "USING email::character varying(64)[]".
What
On Wednesday, July 3, 2024, Rich Shepard wrote:
>
> I'm not using the proper syntax and the postgres alter table doc has no
> example in the alter column choices.
Simpler syntax forms tend to get skipped over when doing examples.
>
> How do I incorporate the "USING email::..." string?
>
ALTE
On Tue, 2 Jul 2024, Christophe Pettus wrote:
To be clear, I wasn't suggesting stuffing them all into a text column with
a delimiter, but storing them in a text *array* field, each email address
one component of the array.
Christophe,
I'm not using the proper syntax and the postgres alter tabl
> On Jul 2, 2024, at 15:11, Rich Shepard wrote:
> This data set is the
> only one I've encountered that has a very few multiple email addresses for a
> person.
That's pretty common out in the world. Just pulling a small dataset I have
available, 4+ email addresses per customer happen frequen
On Tue, 2 Jul 2024, Christophe Pettus wrote:
To be clear, I wasn't suggesting stuffing them all into a text column with
a delimiter, but storing them in a text *array* field, each email address
one component of the array.
Okay. I've not before done that and will learn how. This data set is the
> On Jul 2, 2024, at 14:57, Rich Shepard wrote:
> Using text rather than varchar() is a good suggestion.
To be clear, I wasn't suggesting stuffing them all into a text column with a
delimiter, but storing them in a text *array* field, each email address one
component of the array.
On Tue, 2 Jul 2024, Christophe Pettus wrote:
If you are absolutely 100% sure there will never be any metadata
associated with each email address (like a "valid" flag), you can use
TEXT[] array to store them. Otherwise, it's best to move them into a table
with a foreign key back to the owning rec
> On Jul 2, 2024, at 14:47, Rich Shepard wrote:
> Is there a way
> to accommodate multiple email addresses other than entering both with a
> forward slash separating them in the varchar(64) email address column?
If you are absolutely 100% sure there will never be any metadata associated
with
In data made available from a state regulatory agency I find a few instances
where a facility contact has two email addresses. While multiple locations
are accommodated because they're in a table separate from the facility name
and details, all people associated with a facility and location are in
18 matches
Mail list logo