2017-02-01 4 views
0

Ich hatte gerade eine RDS-Instanz auf eine Postgresql-Datenbank hochgesponnen. Die Datenbank wurde erfolgreich erstellt und ich kann mich verbinden. Das Problem ist, wenn ich diesen Code ausführen:Tabelle I erfolgreich erstellt fehlt

CREATE SCHEMA hollywood; 
CREATE TABLE films (title text, release date, awards text[]); 
SELECT * FROM hollywood.films; 

Dies ist die Ausgabe erhalte ich:

Schema hollywood created 
Table films created 
An error occurred when executing the SQL command: 
SELECT * FROM hollywood.films 

ERROR: relation "hollywood.films" does not exist 

Was soll ich hier fehlt? Ich fügte doppelte Anführungszeichen um den Schemanamen hinzu, aber ohne Erfolg. Ich öffnete die Berechtigungen für den Benutzer auf diese Weise, aber ohne Erfolg (sehr schlecht, ich weiß)

grant all privileges on all tables in schema hollywood to bi; 

ich den Suchpfad vor meiner select-Anweisung thusly hinzugefügt:

SET search_path TO hollywood; select.... 

Keine Änderung.

+2

"* Ich habe den Suchpfad *" - sollten Sie das getan haben, bevor Sie die Tabelle erstellen. Mit dem Standardsuchpfad wurde die Tabelle 'filme' im öffentlichen Schema erstellt. –

+0

Ich habe das gerade erkannt. – Alan

Antwort

4

Versuchen:

CREATE SCHEMA hollywood; 
CREATE TABLE hollywood.films (title text, release date, awards text[]); 
SELECT * FROM hollywood.films; 

oder

CREATE SCHEMA hollywood; 
SET search_path TO hollywood; 
CREATE TABLE films (title text, release date, awards text[]); 
SELECT * FROM films; 
+0

Ich habe gerade meinen (sehr dummen) Fehler bemerkt. Akzeptiert und abgestimmt. – Alan

Verwandte Themen