File: system_functions.test

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (98 lines) | stat: -rw-r--r-- 1,461 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# name: test/sql/pg_catalog/system_functions.test
# description: Test various postgres' system functions (https://www.postgresql.org/docs/9.1/functions-info.html)
# group: [pg_catalog]

# avoid loading a storage database because it changes the initial database name
query I
SELECT CURRENT_USER
----
duckdb

query I
SELECT CURRENT_CATALOG
----
memory

query I
SELECT CURRENT_DATABASE()
----
memory

query I
SELECT pg_catalog.CURRENT_DATABASE()
----
memory

query I
SELECT USER
----
duckdb

query I
SELECT SESSION_USER
----
duckdb

statement ok
SELECT version();

query I
SELECT current_query();
----
SELECT current_query();

query I
SELECT pg_catalog.current_query();
----
SELECT pg_catalog.current_query();

query IIII
SELECT 1, 2, 3, current_query();
----
1	2	3	SELECT 1, 2, 3, current_query();

query I
SELECT current_schema();
----
main

query I
SELECT current_schemas(true);
----
[main, main, main, pg_catalog]

query I
SELECT current_schemas(false);
----
[]

query IIII
SELECT inet_client_addr(), inet_client_port(), inet_server_addr(), inet_server_port();
----
NULL	NULL	NULL	NULL

statement ok
select pg_postmaster_start_time();

query I
SELECT pg_is_other_temp_schema(33)
----
false

query III
SELECT col_description(0, 0), obj_description(0, 'duckdb'), shobj_description(0, 'duckdb');
----
NULL	NULL	NULL

statement ok
select txid_current();

query I
select pg_typeof(1);
----
integer

statement error
SELECT temp.current_user()
----
main.current_user