Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
78454c27
Commit
78454c27
authored
Apr 27, 1997
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*shrug*
parent
df770717
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
752 additions
and
0 deletions
+752
-0
src/test/regress/sql/datetime.sql
src/test/regress/sql/datetime.sql
+149
-0
src/test/regress/sql/destroy.sql
src/test/regress/sql/destroy.sql
+285
-0
src/test/regress/sql/errors.sql
src/test/regress/sql/errors.sql
+275
-0
src/test/regress/sql/timespan.sql
src/test/regress/sql/timespan.sql
+43
-0
No files found.
src/test/regress/sql/datetime.sql
0 → 100644
View file @
78454c27
-- *** testing new built-in time types: datetime, timespan ***
CREATE
TABLE
DATETIME_TBL
(
d1
datetime
);
-- Shorthand values
-- Not testable since these are not constant for regression testing.
-- So, just try to test parser and hope for the best - tgl 97/04/26
INSERT
INTO
DATETIME_TBL
VALUES
(
'current'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'now'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'today'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'yesterday'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'tomorrow'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'tomorrow PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'tomorrow zulu'
);
SELECT
count
(
*
)
AS
one
FROM
DATETIME_TBL
WHERE
d1
=
'today'
::
datetime
;
SELECT
count
(
*
)
AS
one
FROM
DATETIME_TBL
WHERE
d1
=
'tomorrow'
::
datetime
;
SELECT
count
(
*
)
AS
one
FROM
DATETIME_TBL
WHERE
d1
=
'yesterday'
::
datetime
;
SELECT
count
(
*
)
AS
one
FROM
DATETIME_TBL
WHERE
d1
=
'today'
::
datetime
+
'1 day'
::
timespan
;
SELECT
count
(
*
)
AS
one
FROM
DATETIME_TBL
WHERE
d1
=
'today'
::
datetime
-
'1 day'
::
timespan
;
INSERT
INTO
DATETIME_TBL
VALUES
(
'current'
);
BEGIN
;
INSERT
INTO
DATETIME_TBL
VALUES
(
'now'
);
SELECT
count
(
*
)
AS
one
FROM
DATETIME_TBL
WHERE
d1
=
'now'
::
datetime
;
END
;
DELETE
FROM
DATETIME_TBL
;
-- Special values
INSERT
INTO
DATETIME_TBL
VALUES
(
'invalid'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'-infinity'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'infinity'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'epoch'
);
-- Postgres v6.0 standard output format
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mon Feb 10 17:32:01 1997 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Invalid Abstime'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Undefined Abstime'
);
-- Variations on Postgres v6.1 standard output format
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mon Feb 10 17:32:01.000001 1997 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mon Feb 10 17:32:01.999999 1997 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mon Feb 10 17:32:01.4 1997 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mon Feb 10 17:32:01.5 1997 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mon Feb 10 17:32:01.6 1997 PST'
);
-- ISO 8601 format
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-01-02'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-01-02 03:04:05'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-02-10 17:32:01-08'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-02-10 17:32:01-0800'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-02-10 17:32:01 -08:00'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'19970210 173201 -0800'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-06-10 17:32:01 -07:00'
);
-- Variations for acceptable input formats
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 10 17:32:01 1997 -0800'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 10 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 10 5:32PM 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997/02/10 17:32:01-0800'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-02-10 17:32:01 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb-10-1997 17:32:01 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'02-10-1997 17:32:01 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'19970210 173201 PST'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'97FEB10 5:32:01PM UTC'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'97/02/10 17:32:01 UTC'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'97.041 17:32:01 UTC'
);
-- Check date conversion and date arithmetic
INSERT
INTO
DATETIME_TBL
VALUES
(
'1997-06-10 18:32:01 PDT'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 10 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 11 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 12 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 13 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 14 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 15 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 0097 BC'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 0097'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 0597'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 1097'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 1697'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 1797'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 1897'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 2097'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 28 17:32:01 1996'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 29 17:32:01 1996'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mar 01 17:32:01 1996'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Dec 30 17:32:01 1996'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Dec 31 17:32:01 1996'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Jan 01 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 28 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 29 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Mar 01 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Dec 30 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Dec 31 17:32:01 1997'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Dec 31 17:32:01 1999'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Jan 01 17:32:01 2000'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Dec 31 17:32:01 2000'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Jan 01 17:32:01 2001'
);
-- Currently unsupported syntax and ranges
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 -0097'
);
INSERT
INTO
DATETIME_TBL
VALUES
(
'Feb 16 17:32:01 5097 BC'
);
SELECT
''
AS
sixtythree
,
d1
FROM
DATETIME_TBL
;
-- Demonstrate functions and operators
SELECT
''
AS
fortythree
,
d1
FROM
DATETIME_TBL
WHERE
d1
>
'1997-01-02'
::
datetime
and
d1
!=
'current'
::
datetime
;
SELECT
''
AS
fifteen
,
d1
FROM
DATETIME_TBL
WHERE
d1
<
'1997-01-02'
::
datetime
and
d1
!=
'current'
::
datetime
;
SELECT
''
AS
one
,
d1
FROM
DATETIME_TBL
WHERE
d1
=
'1997-01-02'
::
datetime
and
d1
!=
'current'
::
datetime
;
SELECT
''
AS
fiftyeight
,
d1
FROM
DATETIME_TBL
WHERE
d1
!=
'1997-01-02'
::
datetime
and
d1
!=
'current'
::
datetime
;
SELECT
''
AS
sixteen
,
d1
FROM
DATETIME_TBL
WHERE
d1
<=
'1997-01-02'
::
datetime
and
d1
!=
'current'
::
datetime
;
SELECT
''
AS
fortyfour
,
d1
FROM
DATETIME_TBL
WHERE
d1
>=
'1997-01-02'
::
datetime
and
d1
!=
'current'
::
datetime
;
SELECT
''
AS
sixtythree
,
d1
+
'1 year'
::
timespan
AS
one_year
FROM
DATETIME_TBL
;
SELECT
''
AS
sixtythree
,
d1
-
'1 year'
::
timespan
AS
one_year
FROM
DATETIME_TBL
;
-- Casting within a BETWEEN qualifier should probably be allowed by the parser. - tgl 97/04/26
--SELECT '' AS fifty, d1 - '1997-01-02'::datetime AS diff
-- FROM DATETIME_TBL WHERE d1 BETWEEN '1902-01-01'::datetime AND '2038-01-01'::datetime;
SELECT
''
AS
fifty
,
d1
-
'1997-01-02'
::
datetime
AS
diff
FROM
DATETIME_TBL
WHERE
d1
BETWEEN
'1902-01-01'
AND
'2038-01-01'
;
SELECT
''
AS
fortynine
,
date_part
(
'year'
,
d1
)
AS
year
,
date_part
(
'month'
,
d1
)
AS
month
,
date_part
(
'day'
,
d1
)
AS
day
,
date_part
(
'hour'
,
d1
)
AS
hour
,
date_part
(
'minute'
,
d1
)
AS
minute
,
date_part
(
'second'
,
d1
)
AS
second
FROM
DATETIME_TBL
WHERE
d1
BETWEEN
'1902-01-01'
AND
'2038-01-01'
;
SELECT
''
AS
fortynine
,
date_part
(
'quarter'
,
d1
)
AS
quarter
,
date_part
(
'msec'
,
d1
)
AS
msec
,
date_part
(
'usec'
,
d1
)
AS
usec
FROM
DATETIME_TBL
WHERE
d1
BETWEEN
'1902-01-01'
AND
'2038-01-01'
;
src/test/regress/sql/destroy.sql
0 → 100644
View file @
78454c27
--
-- destroy.source
--
-- $Header: /cvsroot/pgsql/src/test/regress/sql/Attic/destroy.sql,v 1.1 1997/04/27 03:56:20 scrappy Exp $
--
--
-- this will fail if the user is not the postgres superuser.
-- if it does, don't worry about it (you can turn usersuper
-- back on as "postgres"). too many people don't follow
-- directions and run this as "postgres", though...
--
UPDATE
pg_user
SET
usesuper
=
't'
::
bool
WHERE
usename
=
'postgres'
;
--
-- FUNCTION REMOVAL
--
DROP
FUNCTION
hobbies
(
person
);
DROP
FUNCTION
hobby_construct
(
text
,
text
);
DROP
FUNCTION
equipment
(
hobbies_r
);
DROP
FUNCTION
user_relns
();
DROP
FUNCTION
widget_in
(
opaque
);
DROP
FUNCTION
widget_out
(
opaque
);
DROP
FUNCTION
pt_in_widget
(
point
,
widget
);
DROP
FUNCTION
overpaid
(
emp
);
DROP
FUNCTION
boxarea
(
box
);
DROP
FUNCTION
interpt_pp
(
path
,
path
);
DROP
FUNCTION
reverse_c16
(
char16
);
--
-- OPERATOR REMOVAL
--
DROP
OPERATOR
##
(
path
,
path
);
DROP
OPERATOR
<%
(
point
,
widget
);
-- left unary
DROP
OPERATOR
@#@
(
none
,
int4
);
-- right unary
DROP
OPERATOR
#@#
(
int4
,
none
);
-- right unary
DROP
OPERATOR
#%#
(
int4
,
none
);
--
-- ABSTRACT DATA TYPE REMOVAL
--
DROP
TYPE
city_budget
;
DROP
TYPE
widget
;
--
-- RULE REMOVAL
-- (is also tested in queries.source)
--
--
-- AGGREGATE REMOVAL
--
DROP
AGGREGATE
newavg
;
DROP
AGGREGATE
newsum
;
DROP
AGGREGATE
newcnt
;
--
-- CLASS REMOVAL
-- (inheritance hierarchies are deleted in reverse order)
--
--
-- DROP ancillary data structures (i.e. indices)
--
DROP
INDEX
onek_unique1
;
DROP
INDEX
onek_unique2
;
DROP
INDEX
onek_hundred
;
DROP
INDEX
onek_stringu1
;
DROP
INDEX
tenk1_unique1
;
DROP
INDEX
tenk1_unique2
;
DROP
INDEX
tenk1_hundred
;
DROP
INDEX
tenk2_unique1
;
DROP
INDEX
tenk2_unique2
;
DROP
INDEX
tenk2_hundred
;
-- DROP INDEX onek2_u1_prtl;
-- DROP INDEX onek2_u2_prtl;
-- DROP INDEX onek2_stu1_prtl;
DROP
INDEX
rect2ind
;
DROP
INDEX
rix
;
DROP
INDEX
iix
;
DROP
INDEX
six
;
DROP
INDEX
hash_i4_index
;
DROP
INDEX
hash_c16_index
;
DROP
INDEX
hash_txt_index
;
DROP
INDEX
hash_f8_index
;
-- DROP INDEX hash_ovfl_index;
DROP
INDEX
bt_i4_index
;
DROP
INDEX
bt_c16_index
;
DROP
INDEX
bt_txt_index
;
DROP
INDEX
bt_f8_index
;
DROP
TABLE
onek
;
DROP
TABLE
onek2
;
DROP
TABLE
tenk1
;
DROP
TABLE
tenk2
;
DROP
TABLE
Bprime
;
DROP
TABLE
hobbies_r
;
DROP
TABLE
equipment_r
;
DROP
TABLE
aggtest
;
DROP
TABLE
xacttest
;
DROP
TABLE
arrtest
;
DROP
TABLE
iportaltest
;
DROP
TABLE
f_star
;
DROP
TABLE
e_star
;
DROP
TABLE
d_star
;
DROP
TABLE
c_star
;
DROP
TABLE
b_star
;
DROP
TABLE
a_star
;
--
-- must be in reverse inheritance order
--
DROP
TABLE
stud_emp
;
DROP
TABLE
student
;
DROP
TABLE
slow_emp4000
;
DROP
TABLE
fast_emp4000
;
DROP
TABLE
emp
;
DROP
TABLE
person
;
DROP
TABLE
ramp
;
DROP
TABLE
real_city
;
DROP
TABLE
dept
;
DROP
TABLE
ihighway
;
DROP
TABLE
shighway
;
DROP
TABLE
road
;
DROP
TABLE
city
;
DROP
TABLE
hash_i4_heap
;
DROP
TABLE
hash_c16_heap
;
DROP
TABLE
hash_txt_heap
;
DROP
TABLE
hash_f8_heap
;
-- DROP TABLE hash_ovfl_heap;
DROP
TABLE
bt_i4_heap
;
DROP
TABLE
bt_c16_heap
;
DROP
TABLE
bt_txt_heap
;
DROP
TABLE
bt_f8_heap
;
DROP
TABLE
BOOLTBL1
;
DROP
TABLE
BOOLTBL2
;
DROP
TABLE
ABSTIME_TBL
;
DROP
TABLE
RELTIME_TBL
;
DROP
TABLE
TINTERVAL_TBL
;
DROP
TABLE
BOX_TBL
;
DROP
TABLE
CHAR_TBL
;
DROP
TABLE
CHAR2_TBL
;
DROP
TABLE
CHAR4_TBL
;
DROP
TABLE
CHAR8_TBL
;
DROP
TABLE
CHAR16_TBL
;
DROP
TABLE
FLOAT4_TBL
;
DROP
TABLE
FLOAT8_TBL
;
DROP
TABLE
INT2_TBL
;
DROP
TABLE
INT4_TBL
;
DROP
TABLE
OID_TBL
;
DROP
TABLE
OIDNAME_TBL
;
DROP
TABLE
OIDINT2_TBL
;
DROP
TABLE
OIDINT4_TBL
;
DROP
TABLE
POINT_TBL
;
DROP
TABLE
POLYGON_TBL
;
--
-- VIRTUAL CLASS REMOVAL
-- (also tests removal of rewrite rules)
--
DROP
VIEW
street
;
DROP
VIEW
iexit
;
DROP
VIEW
toyemp
;
src/test/regress/sql/errors.sql
0 → 100644
View file @
78454c27
--
-- errors.source
--
-- $Header: /cvsroot/pgsql/src/test/regress/sql/errors.sql,v 1.1 1997/04/27 03:56:21 scrappy Exp $
-- bad in postquel, but ok in postsql
select
1
--
-- UNSUPPORTED STUFF
-- doesn't work
-- attachas nonesuch
--
-- doesn't work
-- notify pg_class
--
--
-- RETRIEVE
-- missing relation name
select
-- no such relation
select
*
from
nonesuch
;
-- bad name in target list
select
nonesuch
from
pg_database
;
-- bad attribute name on lhs of operator
select
*
from
pg_database
where
nonesuch
=
pg_database
.
datname
;
-- bad attribute name on rhs of operator
select
*
from
pg_database
where
pg_database
.
datname
=
nonesuch
;
-- bad select distinct on syntax, distinct attribute missing
select
distinct
on
foobar
from
pg_database
;
-- bad select distinct on syntax, distinct attribute not in target list
select
distinct
on
foobar
*
from
pg_database
;
--
-- DELETE
-- missing relation name (this had better not wildcard!)
delete
from
;
-- no such relation
delete
from
nonesuch
;
--
-- DESTROY
-- missing relation name (this had better not wildcard!)
drop
table
;
-- no such relation
drop
table
nonesuch
;
--
-- RENAME
-- relation renaming
-- missing relation name
alter
table
rename
;
-- no such relation
alter
table
nonesuch
rename
to
newnonesuch
;
-- no such relation
alter
table
nonesuch
rename
to
stud_emp
;
-- system relation
alter
table
stud_emp
rename
to
pg_stud_emp
;
-- conflict
alter
table
stud_emp
rename
to
aggtest
;
-- self-conflict
alter
table
stud_emp
rename
to
stud_emp
;
-- attribute renaming
-- no such relation
alter
table
nonesuchrel
rename
column
nonesuchatt
to
newnonesuchatt
;
-- no such attribute
alter
table
emp
rename
column
nonesuchatt
to
newnonesuchatt
;
-- conflict
alter
table
emp
rename
column
salary
to
manager
;
-- conflict
alter
table
emp
rename
column
salary
to
oid
;
--
-- TRANSACTION STUFF
-- not in a xact
abort
;
-- not in a xact
end
;
--
-- DEFINE AGGREGATE
-- left out finalfunc
create
aggregate
newavg1
(
sfunc1
=
int4pl
,
basetype
=
int4
,
stype1
=
int4
,
sfunc2
=
int4inc
,
stype2
=
int4
,
initcond1
=
'0'
,
initcond2
=
'0'
);
-- sfunc return type disagreement
create
aggregate
newavg2
(
sfunc1
=
int4pl
,
basetype
=
int4
,
stype1
=
int4
,
sfunc2
=
int2inc
,
stype2
=
int2
,
finalfunc
=
int4div
,
initcond1
=
'0'
,
initcond2
=
'0'
);
-- sfunc/finalfunc type disagreement
create
aggregate
newavg3
(
sfunc1
=
int4pl
,
basetype
=
int4
,
stype1
=
int4
,
sfunc2
=
int4inc
,
stype2
=
int4
,
finalfunc
=
int2div
,
initcond1
=
'0'
,
initcond2
=
'0'
);
-- left out basetype
create
aggregate
newcnt1
(
sfunc2
=
int4inc
,
stype2
=
int4
,
initcond2
=
'0'
);
-- left out initcond2 (for sfunc2)
create
aggregate
newcnt1
(
sfunc2
=
int4inc
,
basetype
=
int4
,
stype2
=
int4
);
--
-- REMOVE INDEX
-- missing index name
drop
index
;
-- bad index name
drop
index
314159
;
-- no such index
drop
index
nonesuch
;
--
-- REMOVE AGGREGATE
-- missing aggregate name
drop
aggregate
;
-- bad aggregate name
drop
aggregate
314159
;
-- no such aggregate
drop
aggregate
nonesuch
;
--
-- REMOVE FUNCTION
-- missing function name
drop
function
();
-- bad function name
drop
function
314159
();
-- no such function
drop
function
nonesuch
();
--
-- REMOVE TYPE
-- missing type name
drop
type
;
-- bad type name
drop
type
314159
;
-- no such type
drop
type
nonesuch
;
--
-- DROP OPERATOR
-- missing everything
drop
operator
;
-- bad operator name
drop
operator
equals
;
-- missing type list
drop
operator
===
;
-- missing parentheses
drop
operator
int4
,
int4
;
-- missing operator name
drop
operator
(
int4
,
int4
);
-- missing type list contents
drop
operator
===
();
-- no such operator
drop
operator
===
(
int4
);
-- no such operator by that name
drop
operator
===
(
int4
,
int4
);
-- no such type1
drop
operator
=
(
nonesuch
);
-- no such type1
drop
operator
=
(
,
int4
);
-- no such type1
drop
operator
=
(
nonesuch
,
int4
);
-- no such type2
drop
operator
=
(
int4
,
nonesuch
);
-- no such type2
drop
operator
=
(
int4
,
);
--
-- DROP RULE
-- missing rule name
drop
rule
;
-- bad rule name
drop
rule
314159
;
-- no such rule
drop
rule
nonesuch
;
-- bad keyword
drop
tuple
rule
nonesuch
;
-- no such rule
drop
instance
rule
nonesuch
;
-- no such rule
drop
rewrite
rule
nonesuch
;
src/test/regress/sql/timespan.sql
0 → 100644
View file @
78454c27
CREATE
TABLE
TIMESPAN_TBL
(
f1
timespan
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 1 minute'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 5 hour'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 10 day'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 34 year'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 3 months'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 14 seconds ago'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'1 day 2 hours 3 minutes 4 seconds'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'6 years'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'5 months'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'5 months 12 hours'
);
-- badly formatted timespan:
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'badly formatted timespan'
);
INSERT
INTO
TIMESPAN_TBL
(
f1
)
VALUES
(
'@ 30 eons ago'
);
-- test timespan operators
SELECT
''
AS
ten
,
TIMESPAN_TBL
.
*
;
SELECT
''
AS
nine
,
TIMESPAN_TBL
.
*
WHERE
TIMESPAN_TBL
.
f1
<>
'@ 10 days'
::
timespan
;
SELECT
''
AS
three
,
TIMESPAN_TBL
.
*
WHERE
TIMESPAN_TBL
.
f1
<=
'@ 5 hours'
::
timespan
;
SELECT
''
AS
three
,
TIMESPAN_TBL
.
*
WHERE
TIMESPAN_TBL
.
f1
<
'@ 1 day'
::
timespan
;
SELECT
''
AS
one
,
TIMESPAN_TBL
.
*
WHERE
TIMESPAN_TBL
.
f1
=
'@ 34 years'
::
timespan
;
SELECT
''
AS
five
,
TIMESPAN_TBL
.
*
WHERE
TIMESPAN_TBL
.
f1
>=
'@ 1 month'
::
timespan
;
SELECT
''
AS
nine
,
TIMESPAN_TBL
.
*
WHERE
TIMESPAN_TBL
.
f1
>
'@ 3 seconds ago'
::
timespan
;
SELECT
''
AS
fortyfive
,
r1
.
*
,
r2
.
*
FROM
TIMESPAN_TBL
r1
,
TIMESPAN_TBL
r2
WHERE
r1
.
f1
>
r2
.
f1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment