Sha256: a3affcb291ed33837238407808328bdd55cb92903413489ed23a2490f5931fcb

Contents?: true

Size: 362 Bytes

Versions: 16

Compression:

Stored size: 362 Bytes

Contents

CREATE OR REPLACE FUNCTION message_store.id(
  stream_name varchar
)
RETURNS varchar
AS $$
DECLARE
  _id_separator_position integer;
BEGIN
  _id_separator_position := STRPOS(id.stream_name, '-');

  IF _id_separator_position = 0 THEN
    RETURN NULL;
  END IF;

  RETURN SUBSTRING(id.stream_name, _id_separator_position + 1);
END;
$$ LANGUAGE plpgsql
IMMUTABLE;

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
message-db-3.0.0 database/functions/id.sql
message-db-2.1.6 database/functions/id.sql
message-db-2.1.5 database/functions/id.sql
message-db-2.1.4 database/functions/id.sql
message-db-2.1.3 database/functions/id.sql
message-db-2.1.2 database/functions/id.sql
message-db-2.1.1 database/functions/id.sql
message-db-2.1.0 database/functions/id.sql
message-db-2.0.2 database/functions/id.sql
message-db-2.0.1 database/functions/id.sql
message-db-2.0.0 database/functions/id.sql
message-db-1.1.3 database/functions/id.sql
message-db-1.1.2 database/functions/id.sql
message-db-1.1.1 database/functions/id.sql
message-db-1.1.0 database/functions/id.sql
message-db-1.0.0 database/functions/id.sql