Re: Retroactively adding send and recv functions to a type?

2019-08-21 Thread Tom Lane
"Johann 'Myrkraverk' Oskarsson" writes: > The steps I took are > create function sha1_send( sha1 ) returns bytea immutable > language c strict as 'hashtypes', 'sha_send1'; > update pg_type set typsend = 'sha1_send'::regproc > where typname = 'sha1'; > create function sha1_recv(

Re: Retroactively adding send and recv functions to a type?

2019-08-21 Thread Johann 'Myrkraverk' Oskarsson
On Tue, Aug 20, 2019 at 2:46 AM Tom Lane wrote: > > "Johann 'Myrkraverk' Oskarsson" writes: > > On Tue, Aug 20, 2019 at 1:32 AM Tom Lane wrote: > >> You could manually update the pg_type row, and then if you were > >> being fussy, add pg_depend entries showing the type depends on > >> the

Re: Retroactively adding send and recv functions to a type?

2019-08-20 Thread Tom Lane
Stephen Frost writes: > * Vik Fearing (vik.fear...@2ndquadrant.com) wrote: >> We generally discourage updating the catalogs directly.  This was why I >> wrote the CREATE/ALTER DATABASE patch in 2014 that you helped me with >> (fbb1d7d73f8). >> I'm willing to work on a patch for ALTER TYPE if it

Re: Retroactively adding send and recv functions to a type?

2019-08-20 Thread Stephen Frost
Greetings, * Vik Fearing (vik.fear...@2ndquadrant.com) wrote: > On 19/08/2019 19:32, Tom Lane wrote: > > "Johann 'Myrkraverk' Oskarsson" writes: > >> I meant ALTER TYPE. Adding the send and recv functions doesn't seem > >> to supported by ALTER TYPE. > >> Is there a workaround for this? > > You

Re: Retroactively adding send and recv functions to a type?

2019-08-19 Thread Vik Fearing
On 19/08/2019 19:32, Tom Lane wrote: > "Johann 'Myrkraverk' Oskarsson" writes: >> I meant ALTER TYPE. Adding the send and recv functions doesn't seem >> to supported by ALTER TYPE. >> Is there a workaround for this? > You could manually update the pg_type row, and then if you were > being fussy,

Re: Retroactively adding send and recv functions to a type?

2019-08-19 Thread Tom Lane
"Johann 'Myrkraverk' Oskarsson" writes: > On Tue, Aug 20, 2019 at 1:32 AM Tom Lane wrote: >> You could manually update the pg_type row, and then if you were >> being fussy, add pg_depend entries showing the type depends on >> the functions. > Can I do this in a future proof way? That is, is

Re: Retroactively adding send and recv functions to a type?

2019-08-19 Thread Johann 'Myrkraverk' Oskarsson
On Tue, Aug 20, 2019 at 1:32 AM Tom Lane wrote: > > "Johann 'Myrkraverk' Oskarsson" writes: > > I meant ALTER TYPE. Adding the send and recv functions doesn't seem > > to supported by ALTER TYPE. > > Is there a workaround for this? > > You could manually update the pg_type row, and then if you

Retroactively adding send and recv functions to a type?

2019-08-19 Thread Johann 'Myrkraverk' Oskarsson
Dear PostgreSQL General, I wish to add the send and recv functions to a type I didn't write myself. The help for ALTER TABLE seems to indicate this is not supported directly. How can I achieve this? The extension in question is hashtypes on pgxn, https://pgxn.org/dist/hashtypes/ and I did

Re: Retroactively adding send and recv functions to a type?

2019-08-19 Thread Tom Lane
"Johann 'Myrkraverk' Oskarsson" writes: > I meant ALTER TYPE. Adding the send and recv functions doesn't seem > to supported by ALTER TYPE. > Is there a workaround for this? You could manually update the pg_type row, and then if you were being fussy, add pg_depend entries showing the type

Re: Retroactively adding send and recv functions to a type?

2019-08-19 Thread Johann 'Myrkraverk' Oskarsson
On Tue, Aug 20, 2019 at 1:03 AM Johann 'Myrkraverk' Oskarsson wrote: > The help for ALTER TABLE seems to indicate this is not supported directly. I meant ALTER TYPE. Adding the send and recv functions doesn't seem to supported by ALTER TYPE. Is there a workaround for this? -- Johann I'm