Skip to content

Conversation

@cyrilleberger
Copy link

No description provided.

@strk
Copy link
Member

strk commented May 26, 2015

Great! Would you be able to also provide a testcase for this ?

@cyrilleberger
Copy link
Author

I will have a look. My test cases for it are deeply entangled in our application, but I should be able to write something standalone. Do you have existing testcase for the SQL function that can I have a look at?

@strk
Copy link
Member

strk commented May 26, 2015

The SQL: https://github.com/pgpointcloud/pointcloud/tree/master/pgsql/sql
The expected results: https://github.com/pgpointcloud/pointcloud/tree/master/pgsql/expected

Tests are run by "make installcheck", you can see them run by travis here:
https://travis-ci.org/pgpointcloud/pointcloud/builds

Testing binary input/output is tricky. In PostGIS we do it via COPY, see
https://github.com/postgis/postgis/blob/svn-trunk/regress/binary.sql

@Remi-C
Copy link
Contributor

Remi-C commented May 26, 2015

Hm some newbee question : what are the binary protocol used for?
Cheers

@pramsey
Copy link
Contributor

pramsey commented May 26, 2015

When defined with the 'send' and 'recv' slots, they determine what bytes will be sent when a CURSOR is declared as BINARY. Oftentimes sending data over a binary cursor is more efficient than sending over a text one, though it can sometimes be hard to write a good client since you have to deal with the binary representations of all types, not just the big ones you "care" about.

@strk
Copy link
Member

strk commented May 26, 2015

it'll be fun to try at finding a ways to allow upgrades w/out dump-reload...

@pramsey
Copy link
Contributor

pramsey commented May 26, 2015

Can't you? As long as on-disk format doesn't change, there's no reason you cannot use pg_upgrade...

@strk
Copy link
Member

strk commented May 26, 2015

upgrades of pointcloud, not postgresql. there's no way to ALTER TYPE for adding the recv and send attributes.

@cyrilleberger
Copy link
Author

Actually there is a way, you can do:
UPDATE pg_type SET typsend = 'pcpatch_send' WHERE typname='pcpatch';
UPDATE pg_type SET typrecv = 'pcpatch_recv' WHERE typname='pcpatch';

@cyrilleberger
Copy link
Author

So the challenge is that pg_regress use the text protocol. In fact, looking into postgres and postgis code source, it seems that they don't test the binary protocol at all. What I would need to do is write a small C program that run the test.

@strk
Copy link
Member

strk commented May 27, 2015 via email

@strk
Copy link
Member

strk commented Mar 1, 2016

This PR is still in need of properly encoding the UPGRADE path (making sure ALTER EXTENSION update properly inject the new send/recv elements of the type)

@elemoine
Copy link
Contributor

This is old and inactive. Closing…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants