" g.name," \
" g.value," \
" g.parameter_type," \
- " extract(epoch from g.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(g.modification_ts) as modification_ts, " \
" s.tag " \
"FROM " #table_prefix "_global_parameter AS g " \
"INNER JOIN " #table_prefix "_global_parameter_server AS a " \
" s.client_class," \
" s.interface," \
" s.match_client_id," \
- " extract(epoch from s.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(s.modification_ts) as modification_ts, " \
" s.next_server," \
" s.rebind_timer," \
" s.relay," \
" p.start_address," \
" p.end_address," \
" p.subnet_id," \
- " extract(epoch from p.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(p.modification_ts) as modification_ts, " \
" x.option_id," \
" x.code," \
" x.value," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(x.modification_ts) as modification_ts, " \
" o.option_id," \
" o.code," \
" o.value," \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " extract(epoch from o.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(o.modification_ts) as modification_ts, " \
" s.calculate_tee_times," \
" s.t1_percent," \
" s.t2_percent," \
" s.subnet_prefix," \
" s.client_class," \
" s.interface," \
- " extract(epoch from s.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(s.modification_ts) as modification_ts, " \
" s.preferred_lifetime," \
" s.rapid_commit," \
" s.rebind_timer," \
" p.start_address," \
" p.end_address," \
" p.subnet_id," \
- " extract(epoch from p.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(p.modification_ts) as modification_ts, " \
" d.id," \
" d.prefix," \
" d.prefix_length," \
" d.delegated_prefix_length," \
" d.subnet_id," \
- " extract(epoch from d.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(d.modification_ts) as modification_ts, " \
" x.option_id," \
" x.code," \
" x.value," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(x.modification_ts) as modification_ts, " \
" x.pd_pool_id," \
" y.option_id," \
" y.code," \
" y.user_context," \
" y.shared_network_name," \
" y.pool_id," \
- " extract(epoch from y.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(y.modification_ts) as modification_ts, " \
" y.pd_pool_id," \
" o.option_id," \
" o.code," \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " extract(epoch from o.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(o.modification_ts) as modification_ts, " \
" o.pd_pool_id, " \
" s.calculate_tee_times," \
" s.t1_percent," \
" p.client_class," \
" p.require_client_classes," \
" p.user_context," \
- " extract(epoch from p.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(p.modification_ts) as modification_ts, " \
" x.option_id," \
" x.code," \
" x.value," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts " \
+ " gmt_epoch(x.modification_ts) as modification_ts " \
"FROM dhcp4_pool AS p " \
server_join \
"LEFT JOIN dhcp4_options AS x ON x.scope_id = 5 AND p.id = x.pool_id " \
" p.client_class," \
" p.require_client_classes," \
" p.user_context," \
- " extract(epoch from p.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(p.modification_ts) as modification_ts, " \
" x.option_id," \
" x.code," \
" x.value," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(x.modification_ts) as modification_ts, " \
" x.pd_pool_id " \
"FROM dhcp6_pool AS p " \
server_join \
" p.client_class," \
" p.require_client_classes," \
" p.user_context," \
- " extract(epoch from p.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(p.modification_ts) as modification_ts, " \
" x.option_id," \
" x.code," \
" x.value," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(x.modification_ts) as modification_ts, " \
" x.pd_pool_id " \
"FROM dhcp6_pd_pool AS p " \
server_join \
" n.client_class," \
" n.interface," \
" n.match_client_id," \
- " extract(epoch from n.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(n.modification_ts) as modification_ts, " \
" n.rebind_timer," \
" n.relay," \
" n.renew_timer," \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " extract(epoch from o.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(o.modification_ts) as modification_ts, " \
" n.calculate_tee_times," \
" n.t1_percent," \
" n.t2_percent," \
" n.name," \
" n.client_class," \
" n.interface," \
- " extract(epoch from n.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(n.modification_ts) as modification_ts, " \
" n.preferred_lifetime," \
" n.rapid_commit," \
" n.rebind_timer," \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " extract(epoch from o.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(o.modification_ts) as modification_ts, " \
" o.pd_pool_id, " \
" n.calculate_tee_times," \
" n.t1_percent," \
" d.name," \
" d.space," \
" d.type," \
- " extract(epoch from d.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(d.modification_ts) as modification_ts, " \
" d.is_array," \
" d.encapsulate," \
" d.record_types," \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " extract(epoch from o.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(o.modification_ts) as modification_ts, " \
" s.tag " \
pd_pool_id \
"FROM " #table_prefix "_options AS o " \
" a.object_type," \
" a.object_id," \
" a.modification_type," \
- " extract(epoch from r.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(r.modification_ts) as modification_ts, " \
" r.id, " \
" r.log_message " \
"FROM " #table_prefix "_audit AS a " \
" s.id," \
" s.tag," \
" s.description," \
- " extract(epoch from s.modification_ts)::bigint as modification_ts " \
+ " gmt_epoch(s.modification_ts) as modification_ts " \
"FROM " #table_prefix "_server AS s " \
"WHERE s.id > 1 " \
__VA_ARGS__ \
" c.max_valid_lifetime," \
" c.depend_on_known_directly," \
" o.depend_on_known_indirectly, " \
- " extract(epoch from c.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(c.modification_ts) as modification_ts, " \
" d.id," \
" d.code," \
" d.name," \
" d.space," \
" d.type," \
- " extract(epoch from d.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(d.modification_ts) as modification_ts, " \
" d.is_array," \
" d.encapsulate," \
" d.record_types," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(x.modification_ts) as modification_ts, " \
" s.tag " \
"FROM dhcp4_client_class AS c " \
"INNER JOIN dhcp4_client_class_order AS o " \
" c.max_valid_lifetime," \
" c.depend_on_known_directly," \
" o.depend_on_known_indirectly, " \
- " extract(epoch from c.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(c.modification_ts) as modification_ts, " \
" d.id," \
" d.code," \
" d.name," \
" d.space," \
" d.type," \
- " extract(epoch from d.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(d.modification_ts) as modification_ts, " \
" d.is_array," \
" d.encapsulate," \
" d.record_types," \
" x.user_context," \
" x.shared_network_name," \
" x.pool_id," \
- " extract(epoch from x.modification_ts)::bigint as modification_ts, " \
+ " gmt_epoch(x.modification_ts) as modification_ts, " \
" s.tag, " \
" c.preferred_lifetime," \
" c.min_preferred_lifetime, " \
// Create a prepared statement for inserting a TIMESTAMP
PgSqlTaggedStatement statement[] = {
{ 1, { OID_TIMESTAMP }, "timestamp_insert",
- "INSERT INTO BASICS (timestamp_col) values ($1)" }
+ "INSERT INTO BASICS (localtime_col) values ($1)" }
};
ASSERT_NO_THROW(conn_->prepareStatement(statement[0]));
// Now add reasonable day, US National Ice Cream day.
ptime nice_day(date(2021, Jul, 18), duration);
bind_array->addTimestamp(nice_day);
- std::cout << "bind array: " << bind_array->toText() << std::endl;
PgSqlResultPtr r;
RUN_PREP(r, statement[0], bind_array, PGRES_COMMAND_OK);
FETCH_ROWS(r, 1);
// Timestamp column should not be null.
- ASSERT_FALSE(PgSqlExchange::isColumnNull(*r, 0, TIMESTAMP_COL));
+ ASSERT_FALSE(PgSqlExchange::isColumnNull(*r, 0, LOCALTIME_COL));
// Convert fetched value into a ptime.
ptime fetched_time;
- ASSERT_NO_THROW_LOG(PgSqlExchange::getColumnValue(*r, 0, TIMESTAMP_COL,
+ ASSERT_NO_THROW_LOG(PgSqlExchange::getColumnValue(*r, 0, LOCALTIME_COL,
fetched_time));
ASSERT_EQ(fetched_time, nice_day);
" smallint_col, "
" int_col, "
" text_col, "
- " timestamp_col, "
+ " localtime_col, "
" varchar_col, "
" inet4_col, "
" float_col, "
EXPECT_EQ(exp_smallint, worker->getSmallInt(SMALLINT_COL));
EXPECT_EQ(exp_int, worker->getInt(INT_COL));
EXPECT_EQ(exp_text, worker->getString(TEXT_COL));
- EXPECT_EQ(exp_timestamp, worker->getTimestamp(TIMESTAMP_COL));
+ EXPECT_EQ(exp_timestamp, worker->getTimestamp(LOCALTIME_COL));
EXPECT_EQ(exp_varchar, worker->getString(VARCHAR_COL));
EXPECT_EQ(exp_inet4, worker->getInet4(INET4_COL));
EXPECT_EQ(exp_double, worker->getDouble(FLOAT_COL));