2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-19 14:36:24 +00:00

[#2038] kea-admin lease-dump: compatibility with earlier versions of pgsql

This commit is contained in:
Andrei Pavel
2022-01-13 22:29:22 +02:00
parent 5056a60bc2
commit fe38a4f2dd
2 changed files with 10 additions and 10 deletions

View File

@@ -4079,7 +4079,7 @@ RETURNS TABLE (
colonSeparatedHex(encode(hwaddr, 'hex')), colonSeparatedHex(encode(hwaddr, 'hex')),
colonSeparatedHex(encode(client_id, 'hex')), colonSeparatedHex(encode(client_id, 'hex')),
valid_lifetime, valid_lifetime,
extract(epoch from expire), extract(epoch from expire)::bigint,
subnet_id, subnet_id,
fqdn_fwd::int, fqdn_fwd::int,
fqdn_rev::int, fqdn_rev::int,
@@ -4091,7 +4091,7 @@ RETURNS TABLE (
$$ LANGUAGE SQL; $$ LANGUAGE SQL;
-- hwtype and hwaddr_source need to be last to match memfile format. -- hwtype and hwaddr_source need to be last to match memfile format.
DROP FUNCTION IF EXISTS lease6DumpHeader; DROP FUNCTION IF EXISTS lease6DumpHeader();
CREATE OR REPLACE FUNCTION lease6DumpHeader() CREATE OR REPLACE FUNCTION lease6DumpHeader()
RETURNS TEXT AS $$ RETURNS TEXT AS $$
SELECT CAST('address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source' AS TEXT) AS result; SELECT CAST('address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source' AS TEXT) AS result;
@@ -4107,7 +4107,7 @@ RETURNS TABLE (
expire BIGINT, expire BIGINT,
subnet_id BIGINT, subnet_id BIGINT,
pref_lifetime BIGINT, pref_lifetime BIGINT,
name VARCHAR, lease_type SMALLINT,
iaid INT, iaid INT,
prefix_len SMALLINT, prefix_len SMALLINT,
fqdn_fwd INT, fqdn_fwd INT,
@@ -4117,13 +4117,13 @@ RETURNS TABLE (
state INT8, state INT8,
user_context VARCHAR, user_context VARCHAR,
hwtype SMALLINT, hwtype SMALLINT,
hwaddr_source VARCHAR hwaddr_source SMALLINT
) AS $$ ) AS $$
SELECT SELECT
address, address,
colonSeparatedHex(encode(duid, 'hex')), colonSeparatedHex(encode(duid, 'hex')),
valid_lifetime, valid_lifetime,
extract(epoch from expire), extract(epoch from expire)::bigint,
subnet_id, subnet_id,
pref_lifetime, pref_lifetime,
lease_type, lease_type,

View File

@@ -326,7 +326,7 @@ RETURNS TABLE (
colonSeparatedHex(encode(hwaddr, 'hex')), colonSeparatedHex(encode(hwaddr, 'hex')),
colonSeparatedHex(encode(client_id, 'hex')), colonSeparatedHex(encode(client_id, 'hex')),
valid_lifetime, valid_lifetime,
extract(epoch from expire), extract(epoch from expire)::bigint,
subnet_id, subnet_id,
fqdn_fwd::int, fqdn_fwd::int,
fqdn_rev::int, fqdn_rev::int,
@@ -338,7 +338,7 @@ RETURNS TABLE (
\$\$ LANGUAGE SQL; \$\$ LANGUAGE SQL;
-- hwtype and hwaddr_source need to be last to match memfile format. -- hwtype and hwaddr_source need to be last to match memfile format.
DROP FUNCTION IF EXISTS lease6DumpHeader; DROP FUNCTION IF EXISTS lease6DumpHeader();
CREATE OR REPLACE FUNCTION lease6DumpHeader() CREATE OR REPLACE FUNCTION lease6DumpHeader()
RETURNS TEXT AS \$\$ RETURNS TEXT AS \$\$
SELECT CAST('address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source' AS TEXT) AS result; SELECT CAST('address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source' AS TEXT) AS result;
@@ -354,7 +354,7 @@ RETURNS TABLE (
expire BIGINT, expire BIGINT,
subnet_id BIGINT, subnet_id BIGINT,
pref_lifetime BIGINT, pref_lifetime BIGINT,
name VARCHAR, lease_type SMALLINT,
iaid INT, iaid INT,
prefix_len SMALLINT, prefix_len SMALLINT,
fqdn_fwd INT, fqdn_fwd INT,
@@ -364,13 +364,13 @@ RETURNS TABLE (
state INT8, state INT8,
user_context VARCHAR, user_context VARCHAR,
hwtype SMALLINT, hwtype SMALLINT,
hwaddr_source VARCHAR hwaddr_source SMALLINT
) AS \$\$ ) AS \$\$
SELECT SELECT
address, address,
colonSeparatedHex(encode(duid, 'hex')), colonSeparatedHex(encode(duid, 'hex')),
valid_lifetime, valid_lifetime,
extract(epoch from expire), extract(epoch from expire)::bigint,
subnet_id, subnet_id,
pref_lifetime, pref_lifetime,
lease_type, lease_type,