title: Another missing FROM-clause entry for table
body: <p>I'm new to postgresql and I have this problem with trigger, that should just take value from the sequence. If I understood correctly, (tried few examples) in case like this you don't need clause FROM (like in ORACLE you would add 'from dual').</p>
  
  <p>Trigger looks something like that:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION public.trigger_fct_name_id_autoinc()
  RETURNS trigger AS
  $$
  BEGIN
      SELECT "NAME_ID_SEQ".NEXTVAL INTO NEW."ID" ;
  RETURN NEW;
  END
  $$
  LANGUAGE 'plpgsql';
  </code></pre>
  
  <p>Of course, I've done something wrong. Error I get is:</p>
  
  <blockquote>
    <p>ERROR: missing FROM-clause entry for table "NAME_ID_SEQ" Where: PL/pgSQL function trigger_fct_name_id_autoinc() line 3 at SQL statement</p>
  </blockquote>
  
  <p>Tried to find some answers in the web, but either there was none, or I don't understand postgresql well enough to understand what people write. In most topics the answer involves aliases, but I don't think that's the case here.</p>
  
  <p>Should I somehow add FROM clause, or is it just a sign of a different issue?</p>