1. Packages
  2. Planetscale Provider
  3. API Docs
  4. getDatabasePostgres
planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale
planetscale logo
planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale

    DatabasePostgres DataSource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as planetscale from "@pulumi/planetscale";
    
    const myDatabasepostgres = planetscale.getDatabasePostgres({
        organization: "...my_organization...",
    });
    
    import pulumi
    import pulumi_planetscale as planetscale
    
    my_databasepostgres = planetscale.get_database_postgres(organization="...my_organization...")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/planetscale/planetscale"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := planetscale.GetDatabasePostgres(ctx, &planetscale.GetDatabasePostgresArgs{
    			Organization: "...my_organization...",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Planetscale = Pulumi.Planetscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myDatabasepostgres = Planetscale.GetDatabasePostgres.Invoke(new()
        {
            Organization = "...my_organization...",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.planetscale.PlanetscaleFunctions;
    import com.pulumi.planetscale.inputs.GetDatabasePostgresArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var myDatabasepostgres = PlanetscaleFunctions.getDatabasePostgres(GetDatabasePostgresArgs.builder()
                .organization("...my_organization...")
                .build());
    
        }
    }
    
    variables:
      myDatabasepostgres:
        fn::invoke:
          function: planetscale:getDatabasePostgres
          arguments:
            organization: '...my_organization...'
    

    Using getDatabasePostgres

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDatabasePostgres(args: GetDatabasePostgresArgs, opts?: InvokeOptions): Promise<GetDatabasePostgresResult>
    function getDatabasePostgresOutput(args: GetDatabasePostgresOutputArgs, opts?: InvokeOptions): Output<GetDatabasePostgresResult>
    def get_database_postgres(organization: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetDatabasePostgresResult
    def get_database_postgres_output(organization: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetDatabasePostgresResult]
    func GetDatabasePostgres(ctx *Context, args *GetDatabasePostgresArgs, opts ...InvokeOption) (*GetDatabasePostgresResult, error)
    func GetDatabasePostgresOutput(ctx *Context, args *GetDatabasePostgresOutputArgs, opts ...InvokeOption) GetDatabasePostgresResultOutput

    > Note: This function is named GetDatabasePostgres in the Go SDK.

    public static class GetDatabasePostgres 
    {
        public static Task<GetDatabasePostgresResult> InvokeAsync(GetDatabasePostgresArgs args, InvokeOptions? opts = null)
        public static Output<GetDatabasePostgresResult> Invoke(GetDatabasePostgresInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDatabasePostgresResult> getDatabasePostgres(GetDatabasePostgresArgs args, InvokeOptions options)
    public static Output<GetDatabasePostgresResult> getDatabasePostgres(GetDatabasePostgresArgs args, InvokeOptions options)
    
    fn::invoke:
      function: planetscale:index/getDatabasePostgres:getDatabasePostgres
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Organization string
    The name of the organization the database belongs to
    Organization string
    The name of the organization the database belongs to
    organization String
    The name of the organization the database belongs to
    organization string
    The name of the organization the database belongs to
    organization str
    The name of the organization the database belongs to
    organization String
    The name of the organization the database belongs to

    getDatabasePostgres Result

    The following output properties are available:

    AtBackupRestoreBranchesLimit bool
    If the database has reached its backup restored branch limit
    AtDevelopmentBranchUsageLimit bool
    If the database has reached its development branch limit
    BranchesCount double
    The total number of database branches
    BranchesUrl string
    The URL to retrieve this database's branches via the API
    CreatedAt string
    When the database was created
    DataImport GetDatabasePostgresDataImport
    DefaultBranch string
    The default branch for the database
    DefaultBranchReadOnlyRegionsCount double
    Number of read only regions in the default branch
    DefaultBranchShardCount double
    Number of shards in the default branch
    DefaultBranchTableCount double
    Number of tables in the default branch schema
    DevelopmentBranchesCount double
    The total number of database development branches
    HtmlUrl string
    The URL to see this database's branches in the web UI
    Id string
    The ID of the database
    InsightsEnabled bool
    True if query insights is enabled for the database
    InsightsRawQueries bool
    Whether raw SQL queries are collected
    IssuesCount double
    The total number of ongoing issues within a database
    MultipleAdminsRequiredForDeletion bool
    If the database requires multiple admins for deletion
    Name string
    Name of the database
    OpenSchemaRecommendationsCount double
    The total number of schema recommendations
    Organization string
    The name of the organization the database belongs to
    Plan string
    The database plan
    ProductionBranchWebConsole bool
    Whether web console is enabled for production branches
    ProductionBranchesCount double
    The total number of database production branches
    Ready bool
    If the database is ready to be used
    RegionData GetDatabasePostgresRegionData
    RequireApprovalForDeploy bool
    Whether an approval is required to deploy schema changes to this database
    ResizeQueued bool
    True if a branch has a queued resize request
    Resizing bool
    True if a branch is currently resizing
    RestrictBranchRegion bool
    Whether to restrict branch creation to one region
    SchemaLastUpdatedAt string
    When the default branch schema was last changed.
    State string
    State of the database
    UpdatedAt string
    When the database was last updated
    Url string
    The URL to the database API endpoint
    AtBackupRestoreBranchesLimit bool
    If the database has reached its backup restored branch limit
    AtDevelopmentBranchUsageLimit bool
    If the database has reached its development branch limit
    BranchesCount float64
    The total number of database branches
    BranchesUrl string
    The URL to retrieve this database's branches via the API
    CreatedAt string
    When the database was created
    DataImport GetDatabasePostgresDataImport
    DefaultBranch string
    The default branch for the database
    DefaultBranchReadOnlyRegionsCount float64
    Number of read only regions in the default branch
    DefaultBranchShardCount float64
    Number of shards in the default branch
    DefaultBranchTableCount float64
    Number of tables in the default branch schema
    DevelopmentBranchesCount float64
    The total number of database development branches
    HtmlUrl string
    The URL to see this database's branches in the web UI
    Id string
    The ID of the database
    InsightsEnabled bool
    True if query insights is enabled for the database
    InsightsRawQueries bool
    Whether raw SQL queries are collected
    IssuesCount float64
    The total number of ongoing issues within a database
    MultipleAdminsRequiredForDeletion bool
    If the database requires multiple admins for deletion
    Name string
    Name of the database
    OpenSchemaRecommendationsCount float64
    The total number of schema recommendations
    Organization string
    The name of the organization the database belongs to
    Plan string
    The database plan
    ProductionBranchWebConsole bool
    Whether web console is enabled for production branches
    ProductionBranchesCount float64
    The total number of database production branches
    Ready bool
    If the database is ready to be used
    RegionData GetDatabasePostgresRegionData
    RequireApprovalForDeploy bool
    Whether an approval is required to deploy schema changes to this database
    ResizeQueued bool
    True if a branch has a queued resize request
    Resizing bool
    True if a branch is currently resizing
    RestrictBranchRegion bool
    Whether to restrict branch creation to one region
    SchemaLastUpdatedAt string
    When the default branch schema was last changed.
    State string
    State of the database
    UpdatedAt string
    When the database was last updated
    Url string
    The URL to the database API endpoint
    atBackupRestoreBranchesLimit Boolean
    If the database has reached its backup restored branch limit
    atDevelopmentBranchUsageLimit Boolean
    If the database has reached its development branch limit
    branchesCount Double
    The total number of database branches
    branchesUrl String
    The URL to retrieve this database's branches via the API
    createdAt String
    When the database was created
    dataImport GetDatabasePostgresDataImport
    defaultBranch String
    The default branch for the database
    defaultBranchReadOnlyRegionsCount Double
    Number of read only regions in the default branch
    defaultBranchShardCount Double
    Number of shards in the default branch
    defaultBranchTableCount Double
    Number of tables in the default branch schema
    developmentBranchesCount Double
    The total number of database development branches
    htmlUrl String
    The URL to see this database's branches in the web UI
    id String
    The ID of the database
    insightsEnabled Boolean
    True if query insights is enabled for the database
    insightsRawQueries Boolean
    Whether raw SQL queries are collected
    issuesCount Double
    The total number of ongoing issues within a database
    multipleAdminsRequiredForDeletion Boolean
    If the database requires multiple admins for deletion
    name String
    Name of the database
    openSchemaRecommendationsCount Double
    The total number of schema recommendations
    organization String
    The name of the organization the database belongs to
    plan String
    The database plan
    productionBranchWebConsole Boolean
    Whether web console is enabled for production branches
    productionBranchesCount Double
    The total number of database production branches
    ready Boolean
    If the database is ready to be used
    regionData GetDatabasePostgresRegionData
    requireApprovalForDeploy Boolean
    Whether an approval is required to deploy schema changes to this database
    resizeQueued Boolean
    True if a branch has a queued resize request
    resizing Boolean
    True if a branch is currently resizing
    restrictBranchRegion Boolean
    Whether to restrict branch creation to one region
    schemaLastUpdatedAt String
    When the default branch schema was last changed.
    state String
    State of the database
    updatedAt String
    When the database was last updated
    url String
    The URL to the database API endpoint
    atBackupRestoreBranchesLimit boolean
    If the database has reached its backup restored branch limit
    atDevelopmentBranchUsageLimit boolean
    If the database has reached its development branch limit
    branchesCount number
    The total number of database branches
    branchesUrl string
    The URL to retrieve this database's branches via the API
    createdAt string
    When the database was created
    dataImport GetDatabasePostgresDataImport
    defaultBranch string
    The default branch for the database
    defaultBranchReadOnlyRegionsCount number
    Number of read only regions in the default branch
    defaultBranchShardCount number
    Number of shards in the default branch
    defaultBranchTableCount number
    Number of tables in the default branch schema
    developmentBranchesCount number
    The total number of database development branches
    htmlUrl string
    The URL to see this database's branches in the web UI
    id string
    The ID of the database
    insightsEnabled boolean
    True if query insights is enabled for the database
    insightsRawQueries boolean
    Whether raw SQL queries are collected
    issuesCount number
    The total number of ongoing issues within a database
    multipleAdminsRequiredForDeletion boolean
    If the database requires multiple admins for deletion
    name string
    Name of the database
    openSchemaRecommendationsCount number
    The total number of schema recommendations
    organization string
    The name of the organization the database belongs to
    plan string
    The database plan
    productionBranchWebConsole boolean
    Whether web console is enabled for production branches
    productionBranchesCount number
    The total number of database production branches
    ready boolean
    If the database is ready to be used
    regionData GetDatabasePostgresRegionData
    requireApprovalForDeploy boolean
    Whether an approval is required to deploy schema changes to this database
    resizeQueued boolean
    True if a branch has a queued resize request
    resizing boolean
    True if a branch is currently resizing
    restrictBranchRegion boolean
    Whether to restrict branch creation to one region
    schemaLastUpdatedAt string
    When the default branch schema was last changed.
    state string
    State of the database
    updatedAt string
    When the database was last updated
    url string
    The URL to the database API endpoint
    at_backup_restore_branches_limit bool
    If the database has reached its backup restored branch limit
    at_development_branch_usage_limit bool
    If the database has reached its development branch limit
    branches_count float
    The total number of database branches
    branches_url str
    The URL to retrieve this database's branches via the API
    created_at str
    When the database was created
    data_import GetDatabasePostgresDataImport
    default_branch str
    The default branch for the database
    default_branch_read_only_regions_count float
    Number of read only regions in the default branch
    default_branch_shard_count float
    Number of shards in the default branch
    default_branch_table_count float
    Number of tables in the default branch schema
    development_branches_count float
    The total number of database development branches
    html_url str
    The URL to see this database's branches in the web UI
    id str
    The ID of the database
    insights_enabled bool
    True if query insights is enabled for the database
    insights_raw_queries bool
    Whether raw SQL queries are collected
    issues_count float
    The total number of ongoing issues within a database
    multiple_admins_required_for_deletion bool
    If the database requires multiple admins for deletion
    name str
    Name of the database
    open_schema_recommendations_count float
    The total number of schema recommendations
    organization str
    The name of the organization the database belongs to
    plan str
    The database plan
    production_branch_web_console bool
    Whether web console is enabled for production branches
    production_branches_count float
    The total number of database production branches
    ready bool
    If the database is ready to be used
    region_data GetDatabasePostgresRegionData
    require_approval_for_deploy bool
    Whether an approval is required to deploy schema changes to this database
    resize_queued bool
    True if a branch has a queued resize request
    resizing bool
    True if a branch is currently resizing
    restrict_branch_region bool
    Whether to restrict branch creation to one region
    schema_last_updated_at str
    When the default branch schema was last changed.
    state str
    State of the database
    updated_at str
    When the database was last updated
    url str
    The URL to the database API endpoint
    atBackupRestoreBranchesLimit Boolean
    If the database has reached its backup restored branch limit
    atDevelopmentBranchUsageLimit Boolean
    If the database has reached its development branch limit
    branchesCount Number
    The total number of database branches
    branchesUrl String
    The URL to retrieve this database's branches via the API
    createdAt String
    When the database was created
    dataImport Property Map
    defaultBranch String
    The default branch for the database
    defaultBranchReadOnlyRegionsCount Number
    Number of read only regions in the default branch
    defaultBranchShardCount Number
    Number of shards in the default branch
    defaultBranchTableCount Number
    Number of tables in the default branch schema
    developmentBranchesCount Number
    The total number of database development branches
    htmlUrl String
    The URL to see this database's branches in the web UI
    id String
    The ID of the database
    insightsEnabled Boolean
    True if query insights is enabled for the database
    insightsRawQueries Boolean
    Whether raw SQL queries are collected
    issuesCount Number
    The total number of ongoing issues within a database
    multipleAdminsRequiredForDeletion Boolean
    If the database requires multiple admins for deletion
    name String
    Name of the database
    openSchemaRecommendationsCount Number
    The total number of schema recommendations
    organization String
    The name of the organization the database belongs to
    plan String
    The database plan
    productionBranchWebConsole Boolean
    Whether web console is enabled for production branches
    productionBranchesCount Number
    The total number of database production branches
    ready Boolean
    If the database is ready to be used
    regionData Property Map
    requireApprovalForDeploy Boolean
    Whether an approval is required to deploy schema changes to this database
    resizeQueued Boolean
    True if a branch has a queued resize request
    resizing Boolean
    True if a branch is currently resizing
    restrictBranchRegion Boolean
    Whether to restrict branch creation to one region
    schemaLastUpdatedAt String
    When the default branch schema was last changed.
    state String
    State of the database
    updatedAt String
    When the database was last updated
    url String
    The URL to the database API endpoint

    Supporting Types

    GetDatabasePostgresDataImport

    DataSource GetDatabasePostgresDataImportDataSource
    FinishedAt string
    When the import finished
    ImportCheckErrors string
    Errors encountered during the import check
    StartedAt string
    When the import started
    State string
    State of the data import
    DataSource GetDatabasePostgresDataImportDataSource
    FinishedAt string
    When the import finished
    ImportCheckErrors string
    Errors encountered during the import check
    StartedAt string
    When the import started
    State string
    State of the data import
    dataSource GetDatabasePostgresDataImportDataSource
    finishedAt String
    When the import finished
    importCheckErrors String
    Errors encountered during the import check
    startedAt String
    When the import started
    state String
    State of the data import
    dataSource GetDatabasePostgresDataImportDataSource
    finishedAt string
    When the import finished
    importCheckErrors string
    Errors encountered during the import check
    startedAt string
    When the import started
    state string
    State of the data import
    data_source GetDatabasePostgresDataImportDataSource
    finished_at str
    When the import finished
    import_check_errors str
    Errors encountered during the import check
    started_at str
    When the import started
    state str
    State of the data import
    dataSource Property Map
    finishedAt String
    When the import finished
    importCheckErrors String
    Errors encountered during the import check
    startedAt String
    When the import started
    state String
    State of the data import

    GetDatabasePostgresDataImportDataSource

    Database string
    Database name of the data source
    Hostname string
    Hostname of the data source
    Port double
    Port of the data source
    Database string
    Database name of the data source
    Hostname string
    Hostname of the data source
    Port float64
    Port of the data source
    database String
    Database name of the data source
    hostname String
    Hostname of the data source
    port Double
    Port of the data source
    database string
    Database name of the data source
    hostname string
    Hostname of the data source
    port number
    Port of the data source
    database str
    Database name of the data source
    hostname str
    Hostname of the data source
    port float
    Port of the data source
    database String
    Database name of the data source
    hostname String
    Hostname of the data source
    port Number
    Port of the data source

    GetDatabasePostgresRegionData

    CurrentDefault bool
    True if the region is the default for new branch creation
    DisplayName string
    Name of the region
    Enabled bool
    Whether or not the region is currently active
    Id string
    The ID of the region
    Location string
    Location of the region
    Provider string
    Provider for the region (ex. AWS)
    PublicIpAddresses List<string>
    Public IP addresses for the region
    Slug string
    The slug of the region
    CurrentDefault bool
    True if the region is the default for new branch creation
    DisplayName string
    Name of the region
    Enabled bool
    Whether or not the region is currently active
    Id string
    The ID of the region
    Location string
    Location of the region
    Provider string
    Provider for the region (ex. AWS)
    PublicIpAddresses []string
    Public IP addresses for the region
    Slug string
    The slug of the region
    currentDefault Boolean
    True if the region is the default for new branch creation
    displayName String
    Name of the region
    enabled Boolean
    Whether or not the region is currently active
    id String
    The ID of the region
    location String
    Location of the region
    provider String
    Provider for the region (ex. AWS)
    publicIpAddresses List<String>
    Public IP addresses for the region
    slug String
    The slug of the region
    currentDefault boolean
    True if the region is the default for new branch creation
    displayName string
    Name of the region
    enabled boolean
    Whether or not the region is currently active
    id string
    The ID of the region
    location string
    Location of the region
    provider string
    Provider for the region (ex. AWS)
    publicIpAddresses string[]
    Public IP addresses for the region
    slug string
    The slug of the region
    current_default bool
    True if the region is the default for new branch creation
    display_name str
    Name of the region
    enabled bool
    Whether or not the region is currently active
    id str
    The ID of the region
    location str
    Location of the region
    provider str
    Provider for the region (ex. AWS)
    public_ip_addresses Sequence[str]
    Public IP addresses for the region
    slug str
    The slug of the region
    currentDefault Boolean
    True if the region is the default for new branch creation
    displayName String
    Name of the region
    enabled Boolean
    Whether or not the region is currently active
    id String
    The ID of the region
    location String
    Location of the region
    provider String
    Provider for the region (ex. AWS)
    publicIpAddresses List<String>
    Public IP addresses for the region
    slug String
    The slug of the region

    Package Details

    Repository
    planetscale planetscale/terraform-provider-planetscale
    License
    Notes
    This Pulumi package is based on the planetscale Terraform Provider.
    planetscale logo
    planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale
      Meet Neo: Your AI Platform Teammate