summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Uzhakov <[email protected]>2022-06-10 09:29:01 +0300
committerSergey Uzhakov <[email protected]>2022-06-10 09:29:01 +0300
commit2e922427b8b4786ba6ab9b8662e91a268ac667ce (patch)
tree470083bf21a48b5be5931cdbafbcf189d916ee18
parentc8519720b711668de540bc36ed3371c56a76b523 (diff)
YQ-1154: support postgres types in public protos
ref:d7f692647c3853f8b796ed2739232dc9964d37e5
-rw-r--r--ydb/public/api/protos/ydb_value.proto13
1 files changed, 12 insertions, 1 deletions
diff --git a/ydb/public/api/protos/ydb_value.proto b/ydb/public/api/protos/ydb_value.proto
index d885d73f8e1..48aba64a6c6 100644
--- a/ydb/public/api/protos/ydb_value.proto
+++ b/ydb/public/api/protos/ydb_value.proto
@@ -50,6 +50,15 @@ message TaggedType {
Type type = 2;
}
+message PgType {
+ // pg object id of the type
+ // full registry could be found here: https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat
+ int32 oid = 1; // required
+ // advanced type details useful for pg wire format proxying
+ int32 typlen = 2; // optional, set to 0 by default
+ int32 typmod = 3; // optional, set to 0 by default
+}
+
message Type {
enum PrimitiveTypeId {
PRIMITIVE_TYPE_ID_UNSPECIFIED = 0x0000;
@@ -99,6 +108,7 @@ message Type {
google.protobuf.NullValue null_type = 202;
google.protobuf.NullValue empty_list_type = 203;
google.protobuf.NullValue empty_dict_type = 204;
+ PgType pg_type = 205;
}
}
@@ -119,8 +129,9 @@ message ValuePair {
* For composite types repeated Items or Pairs used. See below.
*
* The idea is, we do not represent explicitly Optional<T> if value is not null (most common case)
- * - just represents value of T. Numbers of Optional levels we can get from type.
+ * - just represents value of T. Number of Optional levels we can get from type.
* Variant<T> type always represent explicitly
+ * PgType could be stored either in text_value (human-readable format) or bytes_value (internal wire format)
*/
message Value {