pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Steven Hirsch <snhirsch@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Odd behavior with 'currval'
Date: Thu, 8 Feb 2018 10:31:24 -0800
Message-ID: <3d6fe6d5-fbe6-e6fd-982d-7685c90ce7df@aklaver.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1802081313150.5809@z87>
References: <alpine.DEB.2.20.1802081050480.5809@z87>
	<CA+bJJbw-V2_gCUkbFTAn5USXZ9jtHrzh9vVMbB7mwg_yrMDyvQ@mail.gmail.com>
	<alpine.DEB.2.20.1802081243130.5809@z87>
	<de21e719-d208-3193-0788-dd39735a43c0@aklaver.com>
	<alpine.DEB.2.20.1802081313150.5809@z87>

On 02/08/2018 10:20 AM, Steven Hirsch wrote:
> On Thu, 8 Feb 2018, Adrian Klaver wrote:
> 
>> What if you do?:
>>
>> SELECT * FROM udm_asset_type_definition_def_id_seq;
> 
> I get:
> 
> udm_asset_type_definition_def_id_seq    21    1    1    
> 9223372036854775807    1    1    32    false    true

What does the below show?:

\d udm_asset_type_definition_def_id_seq

> 
> 
>> SELECT currval('udm_asset_type_definition_id_seq');
> 
> I get:
> 
> [Code: , SQL State: 42P01]  ERROR: relation 
> "udm_asset_type_definition_id_seq" does not exist
>    Position: 16
> 
>> Also what happens if you do:
>>
>> pg_dump -d db_name -U some_user -s  -t udm_asset_type_definition > 
>> out.sql
> 
> This:
> 
> -- 
> -- Name: udm_asset_type_definition; Type: TABLE; Schema: main; Owner: 
> asset_registry_admins
> -- 
> 
> CREATE TABLE udm_asset_type_definition (
>      def_id bigint DEFAULT 
> nextval('udm_asset_type_definition_def_id_seq'::regclass) NOT NULL,
>      def_name character varying(32) NOT NULL,
> );
> 
> 
> ALTER TABLE udm_asset_type_definition OWNER TO asset_registry_admins;
> 
> -- 
> -- Name: udm_asset_type_definition 
> udm_asset_type_definition_def_name_key; Type: CONSTRAINT; Schema: main; 
> Owner: asset_registry_admins
> -- 
> 
> ALTER TABLE ONLY udm_asset_type_definition
>      ADD CONSTRAINT udm_asset_type_definition_def_name_key UNIQUE 
> (def_name);
> 
> -- 
> -- Name: udm_asset_type_definition; Type: ACL; Schema: main; Owner: 
> asset_registry_admins
> -- 
> 
> GRANT SELECT ON TABLE udm_asset_type_definition TO asset_registry_readers;
> GRANT ALL ON TABLE udm_asset_type_definition TO asset_registry_writers;
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (37+ messages)  latest in thread

Message-ID: <3d6fe6d5-fbe6-e6fd-982d-7685c90ce7df@aklaver.com>
Permalink:  ../3d6fe6d5-fbe6-e6fd-982d-7685c90ce7df@aklaver.com/
Also on:    postgresql.org/message-id/3d6fe6d5-fbe6-e6fd-982d-7685c90ce7df@aklaver.com

 · 

reply

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, snhirsch@gmail.com
  Subject: Re: Odd behavior with 'currval'
  In-Reply-To: <3d6fe6d5-fbe6-e6fd-982d-7685c90ce7df@aklaver.com>
  References: <alpine.DEB.2.20.1802081050480.5809@z87> <CA+bJJbw-V2_gCUkbFTAn5USXZ9jtHrzh9vVMbB7mwg_yrMDyvQ@mail.gmail.com> <alpine.DEB.2.20.1802081243130.5809@z87> <de21e719-d208-3193-0788-dd39735a43c0@aklaver.com> <alpine.DEB.2.20.1802081313150.5809@z87> <3d6fe6d5-fbe6-e6fd-982d-7685c90ce7df@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