From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Björn Lundin <b.f.lundin@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Order by and timestamp
Date: Mon, 16 Mar 2020 08:24:52 -0700
Message-ID: <22d759ed-9ae1-de9a-936c-f8a48bcfaa0d@aklaver.com> (raw)
In-Reply-To: <48A75793-3914-40F5-877C-FD87AE85AE8A@gmail.com>
References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com>
<c171c26b-fd5e-b4bf-ec86-97b6f8dbcbe0@aklaver.com>
<48A75793-3914-40F5-877C-FD87AE85AE8A@gmail.com>
On 3/16/20 1:49 AM, Björn Lundin wrote:
>
>
>> 16 mars 2020 kl. 01:37 skrev Adrian Klaver <adrian.klaver@aklaver.com
>> <mailto:adrian.klaver@aklaver.com>>:
>>
>> On 3/15/20 2:33 PM, Björn Lundin wrote:
>>> Hi!
>>> I have an old database that behaves a bit strange.
>>> I keeps horse races in UK/IE.
>>> I have a program that continuously* adds record into a market table ,
>>> described as below.
>>> *continuously means ’after each race’ which is ca 12:00 --> 23:00.
>>> I then did ’select * from AMARKETS order by STARTTS’
>>
>> Is amarkets in more then one schema?
>
> Yes but the table is empty in other schema (’dry’) - and has less idexes
> It is also present in imports - but empty there as well
Actually the below indicates it is in other databases. A schema would be
a namespace within a database, see here:
https://www.postgresql.org/docs/12/sql-createschema.html
In your original example the 'public' in public.amarkets.
So just to be complete \dn in psql will show you the schemas in a
database. Given the search_path("$user",public) shown below I suspect
you have only a public schema. $user matches a schema named for the
current user and generally is not there.
The times returned below match, so I am at a loss for an explanation at
the moment.
>
> bnl@ibm2:~$ psql -l
> Tidtagning är på.
> AUTOCOMMIT off
> Lista med databaser
> Namn | Ägare | Kodning | Jämförelse | Ctype |
> Åtkomsträttigheter
> -----------+----------+---------+-------------+-------------+-----------------------
> bnl | bnl | UTF8 | sv_SE.UTF-8 | sv_SE.UTF-8 |
> dry | bnl | UTF8 | sv_SE.UTF-8 | sv_SE.UTF-8 |
> imports | bnl | UTF8 | sv_SE.UTF-8 | sv_SE.UTF-8 |
> postgres | postgres | UTF8 | sv_SE.UTF-8 | sv_SE.UTF-8 |
> template0 | postgres | UTF8 | sv_SE.UTF-8 | sv_SE.UTF-8 |
> =c/postgres +
> | | | | |
> postgres=CTc/postgres
> template1 | postgres | UTF8 | sv_SE.UTF-8 | sv_SE.UTF-8 |
> =c/postgres +
> | | | | |
>
>> If so what is search_path?
>
> bnl=> show search_path;
> search_path
> ----------------
> "$user",public
> (1 rad)
>
>
>> I could not replicate the below.
>>
>> What does below show?:
>>
>> select '2016-09-30 13:00:00'::timestamp at time zone 'UTC’;
>
> bnl=> select '2016-09-30 13:00:00'::timestamp at time zone 'UTC';
> timezone
> ------------------------
> 2016-09-30 15:00:00+02
>
>
>> select '2016-10-01 15:35:00'::timestamp at time zone ’UTC’
> bnl=> select '2016-10-01 15:35:00'::timestamp at time zone 'UTC';
> timezone
> ------------------------
> 2016-10-01 17:35:00+02
>
>
> --
> Björn Lundin
> b.f.lundin@gmail.com <mailto:b.f.lundin@gmail.com>
>
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, b.f.lundin@gmail.com
Subject: Re: Order by and timestamp
In-Reply-To: <22d759ed-9ae1-de9a-936c-f8a48bcfaa0d@aklaver.com>
References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <c171c26b-fd5e-b4bf-ec86-97b6f8dbcbe0@aklaver.com> <48A75793-3914-40F5-877C-FD87AE85AE8A@gmail.com> <22d759ed-9ae1-de9a-936c-f8a48bcfaa0d@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox