![]() ![]() TABLE "film_category" CONSTRAINT "film_category_film_id_fkey" FOREIGN KEY (film_id) REFERENCES film(film_id) ON UPDATE CASCADE ON DELETE RESTRICT TABLE "film_actor" CONSTRAINT "film_actor_film_id_fkey" FOREIGN KEY (film_id) REFERENCES film(film_id) ON UPDATE CASCADE ON DELETE RESTRICT "film_language_id_fkey" FOREIGN KEY (language_id) REFERENCES language(language_id) ON UPDATE CASCADE ON DELETE RESTRICT Last_update | timestamp without time zone | | not null | now() Rating | mpaa_rating | | | 'G'::mpaa_rating Replacement_cost | numeric( 5, 2) | | not null | 19.99 Rental_rate | numeric( 4, 2) | | not null | 4.99 Rental_duration | smallint | | not null | 3 Title | character varying( 255) | | not null | +-+-+-+-įilm_id | integer | | not null | nextval( 'film_film_id_seq'::regclass) For example, the following shows the structure of the film table in the sample database: \d filmĬolumn | Type | Collation | Nullable | Default ![]() Third, execute the \d table_name to or \d+ table_name to show the structure of a table. Second, change the current database to dvdrental sample database: \c dvdrental Code language: Shell Session ( shell ) ![]() It’ll prompt you to enter a password for the postgres user. 1) PostgreSQL DESCRIBE TABLE using psqlįirst, connect to the PostgreSQL server using the psql tool: psql -U postgres Code language: Shell Session ( shell ) However, you can query the information in columns of a table in a couple of ways. PostgreSQL does not support the DESCRIBE statement. If you have been using MySQL, you typically use the DESCRIBE statement to find the information about a table. Summary: in this tutorial, you will learn how to use the psql tool and information_schema to describe tables in PostgreSQL. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |